COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
checkpoint3.6.cpp File Reference
#include <iostream>
Include dependency graph for checkpoint3.6.cpp:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( void )

Definition at line 7 of file checkpoint3.6.cpp.

7 {
8 int x;
9 cin >> x;
10 // negative values provided in test cases
11 if ((x % 2 == 1) || (x % 2 == -1)){
12 cout << x << " is odd";
13 }
14 else
15 cout << x << " is even";
16 return 0;
17}