Skip to content

Instantly share code, notes, and snippets.

@AdnanHussainTurki
Last active September 17, 2019 21:22
Show Gist options
  • Save AdnanHussainTurki/dac51c337f39426042b1b5fa04b966c4 to your computer and use it in GitHub Desktop.
Save AdnanHussainTurki/dac51c337f39426042b1b5fa04b966c4 to your computer and use it in GitHub Desktop.
/*
* @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