Arnab Chakraborty

Arnab Chakraborty

3,768 Articles Published

Articles by Arnab Chakraborty

Page 313 of 377

C++ Program to Check Whether a Character is Alphabet or Not

Arnab Chakraborty
Arnab Chakraborty
Updated on 19-Oct-2022 4K+ Views

Using strings or characters is sometimes very useful while solving some logical programming problems. Strings are a collection of characters and characters are 1-byte datatype to hold symbols from ASCII values. The symbols can be letters from English alphabets, numeric digits, or special characters. In this article, we shall learn how to check whether a character is a letter in English an alphabet or not using C++. Checking isalpha() function To check whether a number is an alphabet or not, we can use the isalpha() function from the ctype.h header file. This takes a character as input and returns true ...

Read More

C++ Program to Check Whether a Number is Positive or Negative

Arnab Chakraborty
Arnab Chakraborty
Updated on 19-Oct-2022 5K+ Views

In modern programming languages we work with signed numbers and unsigned numbers also. For signed numbers the numbers can be positive or negative or zero. To represent negative numbers, the systems store the numbers in 2’s complement method. In this article we shall discuss how to determine a given number is positive, or negative in C++. Checking using if-else conditions The basic sign checking can be done by using if else conditions. The syntax for the if-else conditions is like below − Syntax if { perform action when condition is true } else { ...

Read More

C++ Program to convert the Binary number to Gray code using recursion

Arnab Chakraborty
Arnab Chakraborty
Updated on 19-Oct-2022 981 Views

Gray codes or reflected binary codes are a special type of binary representation of numbers in which two successive values differ in only one bit. For example, the binary equivalent of 1 and 2 are 01 and 10, here two bits are changing. But in gray code, the 1 is 01 and 2 is 11, only one bit is changing. In this article, we will see how we can convert a given binary number into its gray code equivalent by using recursion in C++. Passing number as a decimal integer In the first example, we are providing the number in ...

Read More

C++ Program to create a function without argument and without a return value

Arnab Chakraborty
Arnab Chakraborty
Updated on 19-Oct-2022 7K+ Views

Functions in programming languages are used to make codes modular. In many applications, we create sub-modules to make our code easy to write, easy to debug, and also optimized by rejecting unnecessary code again and again. To achieve these features, functions come into the picture. In many cases, functions take arguments and return something. Sometimes it may not take any argument but returns something. Some special cases are also there when the functions do not take any arguments and do not return anything. In this tutorial, we shall cover such functions without argument and return value in C++. Function without ...

Read More

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

Arnab Chakraborty
Arnab Chakraborty
Updated on 19-Oct-2022 955 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 find the hyperbolic arctangent of the given value

Arnab Chakraborty
Arnab Chakraborty
Updated on 19-Oct-2022 262 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
Arnab Chakraborty
Updated on 19-Oct-2022 271 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
Arnab Chakraborty
Updated on 19-Oct-2022 272 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
Arnab Chakraborty
Updated on 19-Oct-2022 594 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
Arnab Chakraborty
Updated on 19-Oct-2022 375 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
Showing 3121–3130 of 3,768 articles
« Prev 1 311 312 313 314 315 377 Next »
Advertisements