Pafnytiu

program 7

Sep 28th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. int main()
  5. {
  6.     float x, y;
  7.     cout << "Write x"<<endl;
  8.     cin >> x;
  9.     if ((x + 2) <= 1) y = pow(x, 2);
  10.     else if (1 < (x + 2) < 10) y = 1 / (x + 2);
  11.     else y = (x + 2);
  12.     cout << "y=" << y << endl;
  13. system("pause");
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment