asked 216k views
3 votes
Write a pseudo-code to check whether a given number is a palindrome. Examples of palindrome: 121, 1331, 2332,78900987,123456654321 etc. Note: You can use the drag and drop option provided below to create the appropriate pseudo-code from the set of statements provided



1 Answer

7 votes

Answer:

numlength = length(number)

rightptr=numlength-1

leftptr=0

while(rightptr-leftptr >= 1)

then

if (number[leftpointer] == number[rightpointer])

rightptr = rightptr -1

leftptr = leftptr +1

continue;

else

print ("Not a palindrome")

exit

endwhile

print ("Is a palindrome")

Step-by-step explanation:

answered
User Shubham R
by
8.1k points