Skip to content

Instantly share code, notes, and snippets.

@aligalehban
Created June 21, 2018 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aligalehban/b88bde683c518103944d46cefefcd4d3 to your computer and use it in GitHub Desktop.
Save aligalehban/b88bde683c518103944d46cefefcd4d3 to your computer and use it in GitHub Desktop.
check number is odd or even number c++ source code - www.alighalehban.com
#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter an integer: ";
cin >> n;
if ( n % 2 == 0)
cout << n << " is even.";
else
cout << n << " is odd.";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment