Programming Code Center(PCC)
[CPP]

(PCC)::[how-to-write-CPP-Program-to-Check-Whether-Number-is-Even-or-Odd]::[cpp]

File Name : Even_or_Odd_using_if_else.cpp

#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;
}

Output :

Even_or_Odd_using_if_else.jpg