Advertisement
Pandarec13

123

Oct 12th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. float y;
  9. float x = 1.00;
  10. cout << "__________________________" << endl;
  11. cout << "x" << " |"<< "\t\ty"<<"|" << endl;
  12. cout << "________|________________|" << endl;
  13.  
  14. while (x <= 3.20) {
  15. if (x <= 2) y = log(pow(abs(x - 2), 2)) + sqrt(x + 3);
  16. else if (x > 2) y = exp(6 - 2 * x) + 2 * cos((pow((x - 3), 3)));
  17. cout << x<<"\t"<< "|"<<" |"<<endl;
  18. cout << " |"<< "\t"<<round(y*100)/100 << "\t"<<" |" << endl;
  19. x += 0.2;
  20. cout << "________|________________|" << endl;
  21.  
  22. }
  23.  
  24. system("pause");
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement