Website Summary Files Commits Branches @commit @diff @stats
path: root / pract_SI / Pract. 04 / Solutions / task2 - example2.cpp
blob: 044087358f6548e0f8c8821d9a8773c096f329b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>

bool isEven(const int num) {
    return !(num % 2);
}

bool isZero(const int num) {
    return num == 0;
}

int main() {
    int num;
    std::cin >> num;
    if (isZero(num)) {
        std::cout << "The number is not ever or odd!";
    }
    else {
        if (isEven(num)) {
            std::cout << "Even";
            return 0;
        }
        std::cout << "Odd";
    }
    return 0;
}