Tuesday, 24 December 2013

Any integer is input through the keyboard. Write a program to find out whether it is an odd number or even number. (c++ code)

#include<iostream>
using namespace std;
#include<conio.h>
int main()
{
  int num; // num=number
 
  cout<<"Enter  number to know weather its is Even or Odd : ";
  cin>>num;
  if(num%2==0)
  {
   cout<<num<< "is Even number";
  }
  else
  {
    cout<<num<<"%d is Odd number";
  }
  getch();
  return 0;

  /*  Letuswithc:

       this page is designed to help you learn C or C++.
  Understandable C and C++ programming tutorials, compiler reviews, source code, tips and tricks. 
         */
}

No comments:

Post a Comment