Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- void f(float x)
- {
- if (!x || x <= -1)cout << "Function undefined";
- else cout << sqrt(pow(x, 3) - 1) / sqrt(pow(x, 2) - 1);
- }
- int main()
- {
- float a, b, h, x;
- cout << "a="; cin >> a;
- cout << "b="; cin >> b;
- cout << "h="; cin >> h;
- cout << "x\tf(x)\n";
- for (x = a; x <= b; x += h)
- {
- cout << x << "\t";
- f(x);
- cout << endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment