Found 7346 Articles for C++

C++ Program to find the hyperbolic cosine of given radian value

Arnab Chakraborty
Updated on 19-Oct-2022 08:28:59

175 Views

Hyperbolic functions, which are defined using the hyperbola rather than the circle, are comparable to normal trigonometric functions. Hyperbolic functions are used in hyperbolic geometry to compute angles and distances. They also show up in the solutions to a large number of linear differential equations, cubic equations, etc. For given angle$\theta$. The hyperbolic cosine function cosh$(\theta)$ is like below $$\mathrm{cos(x)\:=\:\frac{e^x\:+\:e^{-x}}{2}\:=\:\frac{e^{2x}+1}{2e^x}\:=\:\frac{1+e^{-2x}}{2e^{-x}}}$$ In this article, we shall discuss the techniques to get the value of cosh$(\theta)$ in C++ when the angle is given in the radian unit. The cosh() function This cosh$(\theta)$ operation needs the cosh() function from the cmath package in ... Read More

C++ Program to find the hyperbolic sine of given radian value

Arnab Chakraborty
Updated on 17-Oct-2022 13:32:43

202 Views

Normal trigonometric functions have analogous to hyperbolic functions, which are defined using the hyperbola rather than the circle. In hyperbolic geometry, hyperbolic functions are used to calculate angles and distances. Additionally, they appear in the answers to a lot of linear differential equations, cubic equations, etc. For given angle$\theta$. The hyperbolic sine function sinh$(\theta)$ is like below. $$\mathrm{sinh(x)\:=\:\frac{e^x\:-\:e^{-x}}{2}\:=\:\frac{e^{2x}-1}{2e^x}\:=\:\frac{1-e^{-2x}}{2e^-x}}$$ In this article, we shall discuss the techniques to get the value of sinh$(\theta)$ in C++ when the angle is given in the radian unit. The sinh() function To compute the sinh$(\theta)$ The sinh() function from the cmath package will be used. ... Read More

C++ Program to find the tangent of given radian value

Arnab Chakraborty
Updated on 17-Oct-2022 13:15:58

436 Views

The right-angled triangle is the subject of the trigonometry concept known as the Tangent. The ratio between the angle's opposing leg and its adjacent leg when it is thought of as a right triangle is the trigonometric function for an acute angle. To calculate the tangent, we need to know the angle between the hypotenuse and the adjacent edge. Let the angle is πœƒ. The tan$(\thetaπœƒ)$ is like below: $$\mathrm{tan(\theta)\:=\:\frac{opposite}{adjacent}}$$ In this article, we shall discuss the techniques to get the value of tan$(\thetaπœƒ)$ in C++ when the angle is given in the radian unit. The tan() function To compute ... Read More

C++ Program to find the cosine of given radian value

Arnab Chakraborty
Updated on 17-Oct-2022 13:11:17

334 Views

Cosine is a trigonometric term that deals with right-angled triangle. When an acute angle is thought of as being a member of a right triangle, the cosine trigonometric function measures the distance between the angle's neighbouring leg and the hypotenuse. We require the angle between the hypotenuse and the adjacent edge in order to calculate cosine. Let the angle is πœƒ. The cos$(\theta)$ is like below $$\mathrm{cos(\theta)\:=\:\frac{adjacent}{hypotenuse}}$$ In this article, we shall discuss the techniques to get the value of cos$(\theta)$ in C++ when the angle is given in the radian unit. The cos() function To compute the cos$(\theta)$ The ... Read More

C++ Program to find the sine of given radian value

Arnab Chakraborty
Updated on 17-Oct-2022 13:07:42

489 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

C++ Program to calculate the base 2 logarithm of the given value

Arnab Chakraborty
Updated on 17-Oct-2022 13:02:39

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

C++ Program to calculate the cube root of the given number

Arnab Chakraborty
Updated on 17-Oct-2022 12:58:35

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

C++ Program to calculate the Highest Common Factor

Arnab Chakraborty
Updated on 04-Apr-2023 14:13:10

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

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

Arnab Chakraborty
Updated on 17-Oct-2022 12:49:05

904 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
Updated on 17-Oct-2022 12:46:21

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

Advertisements