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 <= -1)
- printf("%lf", 5 / (1 + exp(-2 * x)));
- else if (x <= 15)
- printf("%lf", 4.9 / (2 + (x + 2) * sin(3 * x)));
- else
- printf("%lf", 1.3 * fabs(cos(4 * x)));
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment