Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. double x,f;
  8. cout<<"x= ";
  9. cin>>x;
  10. if(x<=-3)
  11. {
  12. f=x*x+1;
  13. cout<<"f= "<<f<<endl;
  14. }
  15. if(x>-3&&x<3)
  16. {
  17. f=x-2;
  18. cout<<"f= "<<f<<endl;
  19. }
  20. if(x>=3)
  21. {
  22. f=x*x-4*x+5;
  23. cout<<"f= "<<f<<endl;
  24.  
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement