Advertisement
myloyo

3.5.16

Nov 5th, 2022 (edited)
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. void f(float x) {
  6.     if (x == -2) {
  7.         cout << "not defined";
  8.     }
  9.     else cout << (3/abs(pow(x, 3) + 8));
  10.  
  11. }
  12. int main() {
  13.     float a, b, h, x;
  14.     cin >> a >> b >> h;
  15.     cout << "x\tf(x)\n";
  16.     for (x = a; x <= b; x += h) {
  17.         cout << x << "\t";
  18.         f(x);
  19.         cout << endl;
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement