
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7197 Articles for C++

695 Views
Sine is a trigonometric parameter that deals with the right-angled triangle. The sine is the ratio of the opposite side to the hypotenuse. While calculating sine, we need the angle between the hypotenuse and the opposite side. Let the angle is π. The sin(π) is like below β $$\mathrm{sin(\theta)\:=\:\frac{opposite}{hypotenuse}}$$ In this article, we shall discuss the techniques to get the value of sin(π) in C++ when the angle is given in the radian unit. The sin() function To compute the sin(π) we need to use the sin() method from the cmath library. This function takes the angle in radian and ... Read More

2K+ Views
In different applications calculating logarithms for base 2 is somewhat necessary. There are a few shortcut methods to remember a few log values for competitive exams. While using programming, we have a handful of options to calculate logarithm results from library functions and also some tricks to compute them. In this article, we shall discuss a few techniques to compute logarithm base 2 for a given number in C++. Using log2() function The log2() is one library function that is used to calculate the logarithm base 2 for a given parameter. The answer may be an integer or floating point ... Read More

4K+ Views
Multiplying the same number thrice is termed as the cube of that number. Or we can say the number raised to power 3. For instance 3 * 3 * 3 = 27, which is a cubic number. But if we want to perform the reverse operation, we need to find the cube root of the number. For example $\sqrt[3]{27}$ = 3. In this article, we shall discuss how to calculate the cube root of a given number in C++. There are a few different techniques to do so. Using cbrt() function The cbrt() is one library function that is used ... Read More

2K+ Views
The highest Common Factor or Greatest Common Divisor are factors that are maximum and that can divide two or more values without generating any remainder. In this article, we shall discuss a few methods to perform HCF / GCD between two numbers in C++. This is simply a mathematical solution and there are several algorithms present to find GCD. The Euclidean method to find GCD is common. The same algorithm we will use in iterative mode, and recursive mode. Using Iterative method The iterative solution for the Euclidean gcd finding algorithm is shown in the algorithm section. Algorithm ... Read More

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

9K+ 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

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

4K+ Views
Cubes are the basic 3D objects which have 8 vertices, 12-edges, and 6-faces. The volume of a 3D object is how much space it is occupying in the world. In this article, we will see how we can calculate the volume of a cube by writing a C++ program. A cube has all edges of equal length. The area for each face is π2 where π is the length of each side. As 3D objects have length, breadth, and width, so the volume of it will be π3. Let us see the algorithm and corresponding C++ implementation to find the ... Read More

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

742 Views
To memorise the few fundamental multiplication results in tabular or graphic form, use multiplication tables. This article will cover how to produce a multiplication table in C++ that looks like a right-angled triangle. In a select few situations where a larger number of results may be easily memorised, triangular representation is effective. In this format, a table is shown row by row and column by column, with each row containing only the entries that fill that column. To solve this problem, we need basic looping statements in C++. For displaying the numbers in triangular fashion, we need nested looping to ... Read More