WAP to check whether the given number is Palindrome.

Question

Write a program to check whether the given number is palindrome.

Ans:

      INPUT “Enter the Number ” ; NUM

      N = NUM

      DO            

      DIGIT = NUM MOD 10

      REVERSE = REVERSE * 10 + DIGIT

      NUM = NUM 10

      LOOP WHILE NUM < > 0

      IF N = REVERSE THEN PRINT N;
“palindrome” ELSE PRINT N; “not palindrome

END

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top