Last active
September 17, 2019 21:22
-
-
Save AdnanHussainTurki/dac51c337f39426042b1b5fa04b966c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @Author: Adnan | |
* @Date: 2019-08-27 20:33:14 | |
* @Last Modified by: Adnan | |
* @Last Modified time: 2019-09-18 02:44:17 | |
*/ | |
#include <iostream> | |
using namespace std; | |
int main() { | |
cout << "PROGRAM TO CHECK WHETHER THE INPUT NUMBER IS ODD OR EVEN"; | |
cout << "\n"; | |
cout << "========================================================="; | |
int input; | |
cout << "\nEnter the interested number:"; | |
cin >> input; | |
cout << "\nYou have entered:" << input; | |
// Ternary Operator | |
(input%2 == 1) ? cout << "\n\nThe given number is ODD" : cout << "\n\nThe given number is EVEN"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment