Program to check odd or even number in c++ programming language
#include<iostream>
using namespace std;
int main()
{
int a;
cout << "enter the value of a:";
cin >> a;
if (a % 2 == 0)
cout << "this number is even";
else
cout << "this number is odd";
getchar();
getchar();
return 0;
}
Comments
Post a Comment