DigitalOrgano

  • Home
  • About
  • Categories
    • Windows OS
    • Software
    • Android
    • Technology
  • Contact
DigitalOrgano » Technology » C++ Program To Find Even And Odd Number

C++ Program To Find Even And Odd Number

Last updated on June 22, 2020 by Editorial Staff Under Technology

Tweet
Share
Share
Pin

Any number that is divisible by 2 leaving no remainder is called Even number and any number that cannot be divided by 2 is called Odd number.

In this articles we will write a C++ program to find if the given number is Even or Odd.

#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
	int n;
	cout<<"Program to find Even and Odd number"<<endl;
	cout<<"Enter Any Number"<<endl;
	cout<<"Number: ";
	cin>>n;
	if (n%2==0)
	{
		cout<<"The number is Even";
	}
	else
	{
		cout<<"The number is Odd";
	}
	getch();
	return 0;
}

Explanation

When the program start, it will ask for the number from the user.

After the user input the number, the program will perform a modulo division on the given number

If the modulo division is 0, then the number is even, else the number is odd

Compiler Used: CodeBlock

Output

CPP-Program-To-Find-Even-And-Odd-Number

« No Received Option in Bluetooth Tray Icon
Remove Unused Items From Right Click Send To List »

Our Social Links

  • facebook
  • instagram
  • feedburner

Latest Articles

  • Create Shortcut For Any Program Or Folder In My Computer
  • The Best Way To Post Story On Instagram Using PC
  • Download Latest Google Chrome Offline Installer
  • 5 Best Ways to Free Up Drive Space on Windows 10
  • How to Enable Dark Mode in Microsoft Office
  • How to Properly Restore Windows Registry in Windows 10
Copyright © 2025 DigitalOrgano