• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
May 14, 2022 |3.8K Views

C++ Program to Check if a Number is Palindrome or not

  Share  1 Like
Description
Discussion

In this video, we will see a C++ program to check whether a number is a palindrome or not. Basically, A number is said to be palindrome if the reverse of the number is the same as the number.

For examples:
Input: S = “131”
Output: Yes

Explanation: The reverse of the given number is equal to the (131) which is equal to the given number. Therefore, the given number is a palindrome.

For example:
Input: S = “123”
Output: No

Explanation: The reverse of the given number is equal to the (321) which is not equal to the given number. Therefore, the given number is not a palindrome.

Check if a number is palindrome or not: https://www.geeksforgeeks.org/check-if-a-number-is-palindrome/