Advertisement
anon20016

Untitled

Dec 7th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2.  
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main() {
  7. setlocale(LC_ALL, "Russian");
  8.  
  9. // AND == &&
  10. // OR == ||
  11. // == !=
  12. float pi = acos(0) * 2;
  13.  
  14. for (double i = -0.5; i <= 2; i = i + 0.25) {
  15. float x = i;
  16. if (x < 0) {
  17. printf("y(%f) = %f\n", x, x * x + 1);
  18. }
  19. if (x >= 0 && x <= pi / 2) {
  20. printf("y(%f) = %f\n", x, sin(x));
  21. }
  22. if (x > pi / 2) {
  23. printf("y(%f) = %f\n", x, x - 2.1);
  24. }
  25. }
  26.  
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement