Thursday, April 4, 2013

C++ Program to Find Even Odd number



c++ program to find whether a number is even or odd




#include<stdio.h>
#include <iostream>
using namespace std;
int main(){

    int number;
 
    cout << "Enter any integer: ";
    cin >> number;

    if(number % 2 ==0)
         cout << number << " is even number.";
    else
        cout << number <<" is odd number.";
 
    return 0;

}

OUTPUT:
Enter any integer: 15
15 is odd number.



---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
------------------------------------------------------
Searches related to C++ program to check given number is odd or even
c++ program to find whether a number is even or odd
write a c program to find the given number is even or odd
Check Odd or Even Number in C++ | Free C & C++ Programs
C++ Program to Find Even Odd number 
Learning to Program: To check whether the number is Even or Odd
even/odd program help - C++ Forum
c program to check odd or even
C++ program to check given number is odd or even
C++ program to print all odd numbers in given range
C++ code to print all odd and even numbers in given range
C++ code to get sum of all odd numbers in given range

6 comments:

  1. Learn c programming and c graphics in easy way from programmingcampus.com

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. if i run the commands, it is coming as no file such as iostream found

    ReplyDelete
  4. C program to check odd or even

    In general Even numbers are those which are divisible by 2, and which numbers are not divisible 2 is called odd numbers.
    We can easily write even odd program in c programming.

    ReplyDelete