Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define LEN_MAX 30
- void tab(double a, double b, int n, double (*pf)(double)) {
- int sz = b - a;
- double step = 1.0 * sz / n;
- for (double x = a; x <= b; x += step) {
- printf("f(%g)=%g ", x, (*pf)(x));
- }
- puts("");
- }
- int main() {
- //tab(0, 10, 100, sqrt);
- //tab(-10, 10, 20, cos);
- tab(-10, 10, 200, fabs);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement