Latest Articles

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


Ans in Image: