Stay Tuned!

Subscribe to our newsletter to get our newest articles instantly!

C++ Programming

C++ Program to Show Number is Even or Odd Without Using Modulus Operator

Hierarchical Inheritance

Write a program to show an inputted no is even or odd without the use of modulus operator.


  • Start.
  • Read a number,  n
  • a= n-2*(int (n/2)).
  • If a=0 display “The number is even” else display “The number is odd”
  • End

Source Code


using namespace std;

int main()
        int n,a;
        cout<<"Enter a number:";
        cout<<"The number is even"<<endl;
        cout<<"The number is odd"<<endl;


even odd



About Author provides tutorials related to tech and programmings. We are also setting up a community for the users and students.

You may also like

program to find leap year
C++ Programming

C++ Program to Find Leap Year by Using Function

  • March 3, 2016
Write a program to find if the inputted year is a leap year or not by using the concept of