Separating a number into its individual digits

A palindrome is a number or a text phrase that reads the same backwards as forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads in a five-digit integer and determines whether it is a palindrome. [Hint: Use the division and modulus operators to separate the number into its individual digits.]

I'm not very good at math... can someone help me figure out how do separate a number like this into individual digits?

Thanks...
Think about how many 1s, 10s, 100s etc. will go into each number.
thanks for the hint (i feel stupid now)

edit: still having trouble writing this program but I'm gonna try a little more before I ask for more help =p
Last edited on
[Hint: Use the division and modulus operators to separate the number into its individual digits.]

Eg:
12321%10 will return 1, the last digit
12321/10 will return 1232 as it is an integer division
Topic archived. No new replies allowed.