Program Code :
#include<math.h>
#define PI 3.1415
#define MAX 50
main()
{
int angle;
float x,y;
angle=0;
printf(" Angle Cos(angle)\n\n");
while(angle<=MAX)
{
x=(PI/MAX)*angle;
y=cos(x);
printf("%15d%13.4f\n",angle, y);
angle= angle+10;
}
OUTPUT :
Angle Cos (angle)
0 1.0000
10 0.9848
20 0.9397
30 0.8660
40 0.7660
50 0.6428
#include<math.h>
#define PI 3.1415
#define MAX 50
main()
{
int angle;
float x,y;
angle=0;
printf(" Angle Cos(angle)\n\n");
while(angle<=MAX)
{
x=(PI/MAX)*angle;
y=cos(x);
printf("%15d%13.4f\n",angle, y);
angle= angle+10;
}
OUTPUT :
Angle Cos (angle)
0 1.0000
10 0.9848
20 0.9397
30 0.8660
40 0.7660
50 0.6428
0 Comments