Double-precision floating point (±1.7E±308, ~15 decimal digits)
1st Parameter
The angle in radians for which the cosine value is to be computed
Read more about parameters of cos in parameters section
The cosfunction in C language Calculates the cosine of the specified angle in radians.
The cos function computes the cosine of an angle of x radians. The cosine is a periodic function with a period of 2π. For any value of x, the cosine will be between -1 and 1, inclusive. This function is commonly used in various mathematical and scientific applications, particularly those involving trigonometry or periodic phenomena.
The cosfunction takes 1
parameter:
•
double `x`: The angle in radians for which the cosine value is to be computed
Computes the cosine of the given angle `x`, expressed in radians, and returns the result as a `double`.
The cos function return value :
Returns the cosine of x
The return value is in the range [-1, 1]
Output
This example demonstrates the basic usage of the `cos` function for various common angles in radians. It shows the cosine values for 0°, 30°, 45°, 60°, 90°, and 180°.