• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
June 13, 2022 |8.7K Views

C++ Program to Check Whether Number is Even or Odd

Description
Discussion

In this video, we will see a C++ program to Check Whether a Number is Even or Odd. Basically, if a number is divisible by 2 and gives a remainder 0 is known as an Even number. Apart from that, Odd numbers are numbers that are not divisible by 2 and give a remainder of 1.

Examples :
Input: n = 25
Output: Odd

Input: n = 100
Output: Even

In the video to check whether the number is even or odd we use four different methods:
1. Modulus operator
2. Using IF-ELSE condition
3. By using the Ternary operator
4. By using the Bitwise operator

Check whether Given Number is Even or Odd:
https://www.geeksforgeeks.org/check-whether-given-number-even-odd/