Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <cmath>
- #include <iostream>
- using namespace std;
- float f(float x)
- {
- if ((x + 2) <= 1) { return x*x; }
- else if (1<(x + 2)<10) return 1 / (x + 2);
- else { return x + 2; }
- }
- int main()
- {
- float h, a, b;
- cout << "Vvedite h and a and b \n";
- cin >> h >> a >> b;
- cout << "x \t f(x) \n";
- for (float 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
Advertisement