You are here

sin function in c

Sin function returns sine of an angle(in radian).

Declaration: double sin(double);

C programming code

#include <stdio.h>
#include <math.h>
 
int main()
{
  double result, x = M_PI/6;
 
  result = sin(x);
 
  printf("The sin(%lf) = %.2lf\n", x, result);
 
  return 0;
}