Thursday, July 7, 2022
HomeWordPress DevelopmentA Easy C++ Odd or Even Checker

A Easy C++ Odd or Even Checker


Making a easy C++ Odd or Even Checker.

For extra Supply Codes go to right here.

Create the essential c++ program format utilizing header file iostream and namespace std.

#embody <iostream>
utilizing namespace std;

int major() 
{
   return 0;
}
Enter fullscreen mode

Exit fullscreen mode

After this create a integer variable n, and output a message and let the consumer enter a quantity.

   int n;
   cout<<"Enter quantity: ";
   cin>>n;
Enter fullscreen mode

Exit fullscreen mode

Now utilizing if and else we are going to see whether or not the entered quantity is divisible by two, whether it is then its a even quantity in any other case an odd quantity.

   if(npercent2==0)
     cout<<n<<" It's an Even Quantity";
   else
     cout<<n<<" It's an Odd Quantity";
Enter fullscreen mode

Exit fullscreen mode

Now you can full this system and run it in any compiler to verify its working.

#embody <iostream>
utilizing namespace std;

int major() 
{
   int n;
   cout<<"Enter quantity: ";
   cin>>n;
   if(npercent2==0)
     cout<<n<<" It's an Even Quantity";
   else
     cout<<n<<" It's an Odd Quantity";
   return 0;
}
Enter fullscreen mode

Exit fullscreen mode

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments