Program to calculate the values of ‘Cos X’ using library functions.

#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double p, result;
printf("\nEnter the value of X!!");
scanf("%lf",&p);
result = cos ( p * PI / 180);
printf ("Cosine of %lf degrees is %lf\n", p, result );
}

Advertisements

2 thoughts on “Program to calculate the values of ‘Cos X’ using library functions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s