Articles on Trending Technologies

Technical articles with clear explanations and examples

C++ Program to read the height of a person and the print person is taller, dwarf, or average height person

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Oct-2022 1K+ Views

A person’s height determines whether he/ she is tall, dwarf, or average height person. In different regions of the world, the height ranges are different. We are considering Indian standards. In this article, we shall cover how to write a simple program to determine whether a person is taller, dwarf, or of average height person in C++. Let us define the height range and corresponding classification first, then we can use them in the algorithm as well as in our implementation. Height (cm) Type 150 – 170 Average 170 – 195 Tall Below ...

Read More

C++ Program to calculate the volume and area of Sphere

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Oct-2022 10K+ Views

The Sphere is a ball-like 3D object whose all sides are curved surfaces. On a sphere, no plane surface is there. The volume of a sphere is actually how much space it is taking in the space. In this article, we shall cover the techniques to calculate the volume and the surface area of a sphere in C++. A sphere has one basic parameter. The radius π‘Ÿ. We will see the techniques to calculate the volume and area one by one. The volume of a Sphere To calculate the volume of a sphere, we need one input, the radius π‘Ÿ. ...

Read More

C++ Program to calculate the volume and area of the Cylinder

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Oct-2022 9K+ Views

The cylinder is a tube-like 3D object whose base is a circle and has a certain height. The volume of a cylinder is actually how much space it is taking in the space. In this article, we shall cover a few techniques to calculate the volume and the surface area of a cylinder in C++. A cylinder has two basic parameters. The height β„Ž and the radius of its bases π‘Ÿ. The surface area of a cylinder can have two variations. Only the outer curved surface (for hollow and both side open cylinder) and area with the curved surface with ...

Read More

C++ Program to calculate the sum of all odd numbers up to N

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Oct-2022 14K+ Views

Getting series sum is one of the simplest practicing tasks while we are learning programming and logic build up. In mathematics, there are certain ways to find sum of series present in different progressions. In programming, we generate them one by one by implementing the logics, and repeatedly add them to get the sum otherwise perform any other operation if needed. In this article we shall cover techniques to get sum of all odd numbers up to N using C++. There are two possible ways to get this sum with a little variation. Let us see these approaches one by ...

Read More

C++ Program to Round a Number to n Decimal Places

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Oct-2022 26K+ Views

Representing numbers in outputs is an interesting and also important task while we are writing programs in any language. For integer type (short, long, or medium) type data, it is easy to express the numbers as output. For floating point numbers (float or double type), sometimes we need to round them off to certain decimal places. For example, if we want to represent 52.24568 up to three decimal places, some pre-processing needs to be done. In this article, we shall cover a few techniques to represent a floating-point number up to a certain decimal placed by rounding it off. Among ...

Read More

C++ Program to Calculate simple interest and compound interest

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Oct-2022 27K+ Views

After calculating interest on the principal amount, simple interest is calculated by taking the principal amount, the rate of interest, and the number of years it will take to calculate interest. The formula is quite easy to understand. The power law is used to calculate compound interest by taking into account the principal amount, the rate of interest, and the period. Here, the formula is likewise not difficult. In this article, we'll talk about how to calculate simple and compound interest values and then use the C++ programming language to put this logic into practice. Simple Interest Simple interest is ...

Read More

Kotlin Program to Find the Area of a parallelogram

AmitDiwan
AmitDiwan
Updated on 17-Oct-2022 426 Views

In this article, we will understand how to find the area of a parallelogram. The area of a parallelogram is calculated using the formula byΒ βˆ’ base * height Below is a demonstration of the same βˆ’ Suppose our input is βˆ’ Base: 6 Height: 8 The desired output would be βˆ’ Area of parallelogram is: 48 Algorithm Step 1 βˆ’ START. Step 2 βˆ’ Declare three values namely base, height and myResult. Step 3 βˆ’ Define the values. Step 4 βˆ’ Calculate the area using the formula by base * height and store the result. Step ...

Read More

Kotlin Program to Find the Perimeter of a Circle

AmitDiwan
AmitDiwan
Updated on 17-Oct-2022 624 Views

In this article, we will understand how to find the perimeter of a circle. The perimeter of a circle is calculated using the formula. (2*22*radius)/7 You can also write the above as βˆ’ 2β„Όr The value of β„Ό is 22/7 or 3.14. Suppose our input is βˆ’ Radius of the circle : 5 The desired output would be βˆ’ Perimeter of Circle is: 31.428571428571427 Algorithm Step 1 βˆ’ START. Step 2 βˆ’ Declare 2 double values namely radius and myResult. Step 3 βˆ’ Define the values. Step 4 βˆ’ Calculate the perimeter using the formula ...

Read More

Kotlin Program To Find The Area of a Trapezium

AmitDiwan
AmitDiwan
Updated on 17-Oct-2022 368 Views

In this article, we will understand how to find the area of a trapezium. The area of a trapezium is calculated using the formula. (height/2 * (side1 + side2)) Below is a demonstration of the same βˆ’ Suppose our input is βˆ’ side1 = 5 side2 = 6 height = 6 The desired output would be βˆ’ Area of trapezium is: 33.0 Algorithm Step 1 βˆ’ START. Step 2 βˆ’ Declare four integer values namely side1, side2, height and myResult. Step 3 βˆ’ Define the values. Step 4 βˆ’ Calculate the area of the trapezium using ...

Read More

Kotlin Program to Find Area of Square

AmitDiwan
AmitDiwan
Updated on 17-Oct-2022 904 Views

In this article, we will understand how to find the Area of a Square. The area of a square is calculated using the formula. side*side Below is a demonstration of the same βˆ’ Suppose our input is βˆ’ Length of the side : 4 The desired output would be βˆ’ Area of the square : 16 Algorithm Step 1 βˆ’ START. Step 2 βˆ’ Declare 2 integer values namely sideValue and myResult. Step 3 βˆ’ Define the values. Step 4 βˆ’ Calculate the area of the square using the formula side*side and store the result. Step ...

Read More
Showing 42811–42820 of 61,298 articles
Advertisements