WELCOME

Welcome to KoDes4U

Pages

Thursday, March 3, 2011

Use of math.h library functions(C program)

/*Write a program to find cosine of 0 to 180 degree.
Coded for KoDes4U.blogspot.com*/
#include
#include
#include
int main()
{
int degree;
float pi=3.14,x,y;
clrscr();
printf("Degree\tCosine\n");
for(degree=0;degree<=180;degree=degree+10)
{
x=(pi/180)*degree;
y=cos(x);
printf("%d\t%f",degree,y);
printf("\n");
}
getch();
return(0);
}

No comments:

Post a Comment