Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  sinx.c
Language: C/C++
Code:
#include<stdio.h>
#include<math.h>
main()
{
float x,t,sinx=0;
int i,n;
printf("give angle in degrees");
scanf("%f",&x);
printf("give accuracy");
scanf("%d",&n);
x=x*3.1427/180;
for(i=0;i<=n;i++){
t=pow(-1,i)*pow(x,2*(n+1)/(i+1));
sinx=sinx+t;
}
printf('%f',sinx);
}          
Comments: