Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main() {
- double a, b, c, status = scanf("%lf%lf%lf", &a, &b, &c) == 3 && a < b && (b - a) / c == (int)((b - a) / c);
- for (double x = a; x <= b && status; x += c) {
- printf("%lf | ", x);
- if (x <= -2 * M_PI)
- printf("%lf", exp(3 * sin(2 * x + 3)) + 2);
- else if (x <= 4 * M_PI)
- printf("%lf", (1 + x) * log(pow(cos(3 * x), 2) + 0.1));
- else
- printf("%lf", 2 * sin(1 + log(pow(x, 2) - 10 * M_PI)));
- printf("\n");
- }
- if (!status) printf("n/a");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment