Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab6 v1.3Sin,cos,tan,cot
//gcc 5.4.0 //Start Program //Int in //double sin //double cos //double tan //double cot //READ x //COMPUTE sin(x) // sin=((x-3x^3)/3!)+((x^5)/5!)-(x^7)/7!); //COMPUTE cos(in) // numo square loop // deno factorial loop // cos=((1-x^2)/2!)+((x^4)/4!)-((x^6)/6!); //COMPUTE tan(in) // tan=sin/cos //COMPUTE cot(in) // cot=1/tan //PRINT sin, cos,tan, and cot //End Program // #include <stdio.h> int main(void) { int x; //printf("%d\n",x); double sin; double cos; double tan; double cot; printf("Please input number to be trigged\n"); scanf("%d",&x); printf("%d\n",x); double f=(x*x*x*x*x*x*x); double e=(x*x*x*x*x*x); double d=(x*x*x*x*x); double c=(x*x*x*x); double b=(x*x*x); double a=(x*x); sin=x-((b)/(3*2*1))+((d)/(5*4*3*2*1))-((f)/(7*6*5*4*3*2*1)); for(i=0;i<=x;++i) { if(i%2==0) { a=x } else continue; printf("sin=%lf\n",sin); cos=x-((a)/(2*1))+((c)/(4*3*2*1))-((e)/(6*5*4*3*2*1)); tan=sin/cos; cot=1/tan; printf("cos=%lf\ntan=%lf\ncot=%lf\n",cos,tan,cot); }
run
|
edit
|
history
|
help
0
Avance 2 de pregunta 5
Char data type.c
A_141212_OrdenarArray
Simple Fork
swap_talent.c
2.2 Comparision with Matrix Addition Execution Time
Assignment 4
decr
Multiple If statements v1
swap_bitwise.c