Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- int higher(int a, int b);
- int main()
- {
- srand(time(0));
- SetConsoleOutputCP(1251);
- int num1{}, num2{};
- num1 = rand() % 100;
- num2 = rand() % 100;
- cout << "Задані числа: " << num1 << ", " << num2 << endl;
- cout << "Більше з чисел - " << higher(num1, num2);
- }
- int higher(int a, int b) {
- if (a > b || a == b) {
- return a;
- }
- else if (b > a) {
- return b;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement