Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- void tabelare(double a, double b, int n, double(*functie)(double val)) {
- double step = (b - a) / n;
- while (a <= b) {
- printf("f(%f)= %f ", a, functie(a));
- a += step;
- }
- }
- int main() {
- tabelare(-10, 10, 20, fabs);
- tabelare(-10, 10, 20, cos);
- tabelare(-10, 10, 20, sqrt);
- scanf_s("%*c"); // sa nu se inchida consola
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement