Answers for "even and odd in c++"

C++
1

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.";
}
Posted by: Guest on April-16-2021

Browse Popular Code Answers by Language