Sine function in C || Trigonometric Functions || C programming
 

In this, we are going to see a program in which we can find sine of any angle entered in Radians using math.h header file in C programming language.

//Displays sine of the angle using functions

#include <stdio.h>
#include <math.h>
const double pi = 3.1415926535897;

int main()
{
    double x, n;

    printf("Enter the value of x : ");
    scanf("%lf", &x);
    n = x;

    x = ((x * (pi / 180.0)));

    printf("sin(%0.2lf) = %lf", n, sin(x));

    return 0;
}

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post