Open In App

sin() in C

The sin() function in C is a standard library function to find the sine value of the radian angle. It is used to evaluate the trigonometric sine function of an angle. It takes the radian angle as input and returns the sin of that angle. It is defined inside <math.h> header file.

Syntax of sin()

The syntax of sin() function in C is:

double sin(double angle);

Parameters

Return Value

Example of sin()




// C program to illustrate the sin() function
#include <math.h>
#include <stdio.h>
  
int main()
{
    double angle1 = 3.1415926;
    double angle2 = 10;
  
    // printing the sine value of angle1 and angle2
    printf("sin(3.14) = %.2lf\n", sin(angle1));
    printf("sin(10) = %.2lf", sin(angle2));
  
    return 0;
}

Output
sin(3.14) = 0.00
sin(10) = -0.54








Article Tags :