You are here

sin function in C

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

Declaration: double sin(double);

C program

#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;
}

Share this