Tuesday, 7 May 2013

Program In C To Calculate sin,cos and tan values for an angle


#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float n,a,b,c;
clrscr();
printf("Enter the value for the angle: ");
scanf("%f",&n);
a=sin(n);
b=cos(n);
c=tan(n);
printf("Sin(%f) is: %2.2f\n",n,a);
printf("Cos(%f) is: %2.2f\n",n,b);
printf("Tan(%f) is: %2.2f\n",n,c);
getch();
}

No comments:

Post a Comment