|
@ -22,9 +22,10 @@ int divide(int a, int b) { |
|
|
return a / b; |
|
|
return a / b; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// |
|
|
// scientificmode |
|
|
// scientificmode |
|
|
|
|
|
|
|
|
int scientificmode(){ |
|
|
|
|
|
|
|
|
int scientificMode(){ |
|
|
|
|
|
|
|
|
double num, result; |
|
|
double num, result; |
|
|
|
|
|
|
|
@ -62,6 +63,25 @@ int scientificmode(){ |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// graphMode |
|
|
|
|
|
void graphMode() { |
|
|
|
|
|
double x, y; |
|
|
|
|
|
|
|
|
|
|
|
printf("Enter the range for x (start end step): "); |
|
|
|
|
|
double x_start, x_end, x_step; |
|
|
|
|
|
scanf("%lf %lf %lf", &x_start, &x_end, &x_step); |
|
|
|
|
|
|
|
|
|
|
|
printf("\nGraph for the function y = sin(x):\n"); |
|
|
|
|
|
|
|
|
|
|
|
printf(" x\t| y\n"); |
|
|
|
|
|
printf("--------------\n"); |
|
|
|
|
|
|
|
|
|
|
|
for (x = x_start; x <= x_end; x += x_step) { |
|
|
|
|
|
y = sin(x); |
|
|
|
|
|
printf("%.2lf\t| %.2lf\n", x, y); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// change mode |
|
|
// change mode |
|
|
int mode(int userChoice){ |
|
|
int mode(int userChoice){ |
|
|