Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "Russian");
- // AND == &&
- // OR == ||
- // == !=
- float pi = acos(0) * 2;
- for (double i = -0.5; i <= 2; i = i + 0.25) {
- float x = i;
- if (x < 0) {
- printf("y(%f) = %f\n", x, x * x + 1);
- }
- if (x >= 0 && x <= pi / 2) {
- printf("y(%f) = %f\n", x, sin(x));
- }
- if (x > pi / 2) {
- printf("y(%f) = %f\n", x, x - 2.1);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement