odd function c++.com code example
Example: 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.";
}
#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.";
}