#include #include double a=0,s=0,m=0,d=0; int g=0; int main(void) { double x=0, y=0; int option,g; printf("******* Calculator ********\n"); printf("1: Cosine(x)\n"); printf("2: Sine(x)\n"); printf("3: Tangent(x)\n"); printf("4: Sine(x)/Cosine(x)\n"); printf("5: Square root(x)\n"); printf("6: Exponential(x)\n"); printf("7: Natural log(x)\n"); printf("8: Log to base 10(x)\n"); printf("9: Absolute value(x)\n"); printf("10: Ceil to int(x)\n"); printf("11: Floor to int(x)\n"); printf("12: Quit\n"); printf("Enter choice from 1-11, 12 to quit: "); scanf("%d",&option); printf("Enter the number: "); scanf("%lf",&x); switch (option) { case 1: y = cos(x); printf("Cos(%f) = %f\n",x,y); break; case 2: y = sin(x); printf("Sin(%f) = %f\n",x,y); break; case 3: y = tan(x); printf("Tan(%f) = %f\n",x,y); break; case 4: y = sin(x)/cos(x); printf("Sin(%f)/Cos(%f) = %f\n",x,x,y); break; case 5: y = sqrt(x); printf("Sqrt(%f) = %f\n",x,y); break; case 6: y = exp(x); printf("exp(%f) = %f\n",x,y); break; case 7: y = log(x); printf("log(%f) = %f\n",x,y); break; case 8: y = log10(x); printf("log10(%f) = %f\n",x,y); break; case 9: y = fabs(x); printf("abs(%f) = %f\n",x,y); break; case 10: g = ceil(x); printf("ceil(%f) = %d\n",x,g); break; case 11: g = floor(x); printf("floor(%f) = %d\n",x,g); break; case 12: printf("Quitting!!!!!\n"); break; } return 0; }