# Computer Science Question

#1
Just wondering if anyone could help me start this, thank you

Write a programming code to find and print all Palindrome numbers between 1 to 3000.
Print 10 numbers in each line [do not forget to add space between numbers]. To find
a Palindrome number you MUST exactly follow the steps below:
1- For each number, first, calculate the number of digits; You can divide your integer
by 10 and use the integer quotient continuously until you reach zero.
2- Retrieve the first digit from right (last digit when you read your number from left);
you can use modulus operator (%), then make it raised to the correct power of length
e.g., for the first digit it will be raised to power of length minus one (or number of digits
minus one), for the second digit, use number of digits minus two and so on.
3- Repeat step 2, until you have retrieved all digits, then, produce the reverse number.
An example is provided here:
To reverse 125, you need to obtain the length which is 3.
5x103-1+2x103-2+1x103-3 = 521
Once you have calculated the reversed number compare it with the original one and
see whether a Palindrome number has been found.
Do NOT use list, string, list/string operations, any library or recursive function for this
code.
0
6 months ago
#2
Where is the question from and what have you tried?
0
X

new posts
Back
to top
Latest
My Feed

### Oops, nobody has postedin the last few hours.

Why not re-start the conversation?

see more

### See more of what you like onThe Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

### Poll

Join the discussion

Yes (24)
70.59%
No (7)
20.59%
I didn't use it to prepare (3)
8.82%