December 28, 2016

Qbasic Program to check the multi digit number is Palindrome or not.

CLS
INPUT “Enter multi digit number”; N
S = N
WHILE N <> 0
A = N MOD 10
R = R * 10 + A
N = N \ 10
WEND
IF S = R THEN
PRINT “The entered number is "PALINDROME"”
ELSE
PRINT “The entered number is "NOT PALINDROME"”
END IF
END

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.