Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

even and odd in c++

#include <iostream>
using namespace std;

int main()
{
	int n;
	cout << "Enter an integer: ";
	cin >> n;
	(n % 2 == 0) ? cout << n << " Is Even." : cout << n << " Is Odd.";
}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #odd
ADD COMMENT
Topic
Name
4+7 =