Friday, 9 May 2014

Write a program to check whether the given number is even or odd (using ? : ternary operator )

Leave a Comment
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
    int number1,number2,temp;
    cout<<"Enter Number 1 = ";
    cin>>number1;
    if(number1%2==0)
    {
        cout<<"\nIts Ever number ";
    }
    else
        cout<<"\nIts odd number ";
getch();
}
If You Enjoyed This, Take 5 Seconds To Share It