Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void sayHello()
- {
- std::cout << "Hello, programm user!\n";
- //std::cout << "Nice to see you!\n";
- }
- void cycleGreeting(int greetTimes)
- {
- //int greetTimes{ 3 };
- for (int i{ 0 }; i < greetTimes; ++i)
- {
- sayHello();
- }
- }
- int max(int a, int b)
- {
- return (a > b ? a : b);
- }
- int main()
- {
- int x{ 1 };
- int y{ 20 };
- int arr[6]{ 1,5,2,3,7,0 };
- std::cout << "MAX = " << max(x, arr[3]) << '\n';
- std::cout << "Program starts!\n";
- int times{ 4 };
- cycleGreeting((times - 2));
- std::cout << "Program works hard!\n";
- cycleGreeting(0);
- std::cout << "Program works even more harder!\n";
- cycleGreeting(3);
- std::cout << "Program ends!\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement