Skip to main content
Write a program to Check Whether Number is Even or Odd in C++ Language - Program to Check Whether Number is Even or Odd in C++
Program to Check Whether Number is Even or Odd in C++
#include <iostream>
using namespace std;
int main()
{
int n;
cout << endl << "Enter a Positive Number: ";
cin >> n;
if ( n % 2 == 0)
cout << endl << n << " is even number." << endl;
else
cout << endl << n << " is odd number." << endl;
return 0;
}
इस कोड को हमने CODEBLOCK पर बना कर run किया है
Comments
Post a Comment