Advertisement
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;
- int n;
- scanf("%lf%lf%d", &a, &b, &n);
- c = (b - a) / n;
- for (double x = a; x <= b; x += c) {
- printf("%lf | ", x);
- if (x <= 2.5) {
- printf("%lf\n", log(1 + fabs(pow(x, 3) + sin(3 * x))));
- } else if (x <= 7.5) {
- printf("%lf\n", (1 + x) * pow(log(5 * x), 2));
- } else {
- printf("%lf\n", pow(cos(3 * pow(x, 3) + 5), log(pow(x, 2) - 20)));
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement