C++ Program to Find whether given Number is Odd or Even

Find whether given Number is Odd or Even


Write a C++ Program to Find whether given Number is Odd or Even. Here’s simple Program to Find whether given Number is Odd or Even in C++ Programming Language.


For example if user enters an odd number like 5 then the output will be Odd number and if user enters even number like 8 then output will be Even number.

Here is source code of the C++ Program to Find whether given Number is Odd or Even. The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.


SOURCE CODE : :


/*  C++ Program to Find whether given Number is Odd or Even  */

#include<iostream>

using namespace std;

int main()
{
    int a;
    cout<<"Enter any positive number :: ";
    cin>>a;

    if(a%2==0)
    {
       cout<<"\nThe Entered Number [ "<<a<<" ] is EVEN Number.\n";
    }

    else
    {
        cout<<"\nThe Entered Number [ "<<a<<" ] is ODD Number.\n";
    }

    return 0;
}

Output : :


/*  C++ Program to Find whether given Number is Odd or Even  */

Enter any positive number :: 1327

The Entered Number [ 1327 ] is ODD Number.

Process returned 0

Above is the source code for C++ Program to Find whether given Number is Odd or Even which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post….

Leave a Reply