Found 7346 Articles for C++

C++ Program to Find the Product of Two Numbers Using Recursion

Arnab Chakraborty
Updated on 19-Oct-2022 09:19:42

2K+ Views

Recursion is a technique where we call a function from the same function itself. There must be some base or terminating condition to end the recursive call. Recursive procedures are very much helpful to perform complex iterative solution with fewer codes and easier solution approach through sub-operation finding. In this article we shall discuss a recursive approach to perform product (multiplication) between two numbers in C++. Initially we will understand the basic principle, the syntax for recursive function call, the algorithm and the source code. Multiplication using Recursion In high-level languages, there is the multiplication operators available to directly perform ... Read More

C++ Program to convert the string into a floatingpoint number

Arnab Chakraborty
Updated on 19-Oct-2022 09:17:34

483 Views

Static typing is used in the C++. Variables must be defined with a specific type in order to write programmes. Inputs from the console or files must occasionally be read. In this case, the programme is given the string data. Special operations are necessary to transform them into other datatypes. This article will provide the C++ method for converting strings to floating point integers. A couple different methods can be used to accomplish this. Explore each of them separately. Using stringstream in C++ Streams are a fantastic tool in C++. Filestreams, standard input/output streams, etc. are examples of these streams. ... Read More

C++ Program to convert the string into an integer

Arnab Chakraborty
Updated on 19-Oct-2022 09:15:52

12K+ Views

C++ is a statically typed language. To write programs we need to define variables of specified types. Sometimes we need to read inputs from the console or files. In such a scenario the string data are read into the program. To convert them into other datatypes needs special operations. In this article, we shall discuss how to convert strings to integers in C++. There are a few different techniques to do so. Let us explore them one by one. Using stringstream in C++ C++ uses streams for different applications. Such streams are filestreams, standard input/output streams, etc. There is another ... Read More

C++ Program to find the hyperbolic arctangent of the given value

Arnab Chakraborty
Updated on 19-Oct-2022 08:49:04

128 Views

The hyperbola, rather than the circle, is used to define hyperbolic functions. It returns the ratio parameter for the hyperbolic tangent function based on the supplied radian angle. On the contrary, however. To calculate the angle from the hyperbolic-tangent value, inverse hyperbolic trigonometric procedures like the hyperbolic arctangent operation are required. This article will demonstrate how to utilize the C++ hyperbolic inverse-tangent (atanh) function to determine the angle using the hyperbolic tangent value, in radians. The hyperbolic inverse-tangent operation has the following formula − $$\mathrm{cosh^{-1}x\:=\:\frac{1}{2}In\left(\frac{1\:+\:x}{1\:-\:x}\right)}, where \:In\: is\: natural\: logarithm\:(log_e \: k)$$ The atanh() function The angle can be calculated ... Read More

C++ Program to find the hyperbolic arccosine of the given value

Arnab Chakraborty
Updated on 19-Oct-2022 08:47:57

156 Views

Similar to regular trigonometric functions, hyperbolic functions are defined using the hyperbola rather than the circle. From the specified radian angle, it returns the ratio parameter in the hyperbolic cosine function. But, to put it another way, to do the opposite. Inverse hyperbolic trigonometric operations like the hyperbolic arccosine operation are needed to determine the angle from the hyperbolic-cosine value. To calculate the angle using the hyperbolic cosine value, in radians, this tutorial will show how to use the C++ hyperbolic inverse-cosine (acosh) function. The formula for the hyperbolic inverse-cosine operation is as follows − $$\mathrm{cosh^{-1}x\:=\:In(x\:+\:\sqrt{x^2\:-\:1})}, where \:In\: is\: natural\: ... Read More

C++ Program to find the hyperbolic arcsine of the given value

Arnab Chakraborty
Updated on 19-Oct-2022 08:41:35

134 Views

Hyperbolic functions, which are defined using the hyperbola rather than the circle, are comparable to normal trigonometric functions. It returns the ratio parameter in the hyperbolic sine function from the supplied radian angle. But to do the opposite, or to put it another way. If we want to calculate the angle from the hyperbolic-sine value, we require inverse hyperbolic trigonometric operations like the hyperbolic arcsine operation. This lesson will demonstrate how to use the hyperbolic inverse-sine (asinh) function in C++ to calculate the angle using the hyperbolic sine value, in radians. The hyperbolic inverse-sine operation follows the following formula − ... Read More

C++ Program to find the arctangent of the given value

Arnab Chakraborty
Updated on 19-Oct-2022 08:39:22

324 Views

The ratios we use the most in trigonometry include sine, cosine, tangent, and a few more. You can calculate these ratios using an angle. If we are aware of the ratio values, we may also calculate the angle using inverse trigonometric functions. This lesson will show you how to compute the angle using the tangent value, in radians, using C++'s inverse-tangent (arctan) function. The atan() function The angle is calculated using the atan() technique and the inverse trigonometric tangent function. The C++ standard library contains this function. We must import the cmath library before we can utilize this approach. This ... Read More

C++ Program to find the arccosine of the given value

Arnab Chakraborty
Updated on 19-Oct-2022 08:37:01

182 Views

Sine, cosine, tangent, and a few more ratios are some of the ones we utilize the most in trigonometry. These ratios can be computed from an angle. However, we can also determine the angle using inverse trigonometric functions if we know the ratio values. In this tutorial, we'll go through how to use C++'s inverse-cosine (arccosine) function to convert a cosine value to an angle in radians. The acos() function The inverse trigonometric cosine function is used to calculate the angle using the acos() method. This function can be found in the C++ standard library. To use this method, we ... Read More

C++ Program to find the arcsine of the given value

Arnab Chakraborty
Updated on 19-Oct-2022 08:35:33

366 Views

In trigonometry, there are a few ratios that we use the most, sine, cosine, tangent, and some others. From a given angle, these ratios can be calculated. However, if we have the ratio values, we can also calculate the angle using inverse trigonometric functions. In this article, we shall discuss how to get the angle in radian from the sine value through the inverse-sine (arcsine) method in C++. The asin() function The asin() method is used to compute the angle using the inverse trigonometric sine function. This function is present inside the standard library in C++. We need to import ... Read More

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

Arnab Chakraborty
Updated on 19-Oct-2022 08:30:27

179 Views

Similar to regular trigonometric functions, hyperbolic functions are defined using the hyperbola rather than the circle. In hyperbolic geometry, hyperbolic functions are used to calculate angles and distances. In addition, they are found in the answers to plenty of linear differential equations, cubic equations, etc. For given angle$\theta$. The hyperbolic tangent function tanh$(\theta)$ is like below − $$\mathrm{tanh(x)\:=\:\frac{sinh(x)}{cosh(x)}\:=\:\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}\:=\:\frac{e^{2x}-1}{e^{2x}+1}}$$ In this article, we shall discuss the techniques to get the value of tanh$(\theta)$ in C++ when the angle is given in the radian unit. The tanh() function This tanh$(\theta)$ The tanh() function from the C++ cmath library is required for operation. ... Read More

Advertisements