Write c++ code to find no is even or odd.

C++ program to check given number is odd or even .
Write c++ code to find no is even or odd.

#include<stdio.h>

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;

}

No comments:

Post a Comment