Saturday 3 May 2014

To find a number which is even or odd without using mod function

Leave a Comment

Solution:-



#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
    int n;
    cout<<"Enter the number = ";
    cin>>n;
    if(n/2*2==n)
        cout<<"even";
    else
        cout<<"odd";
    getch();
}


If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: