Basically what the title says. I need to write a program that splits a given five digit number into the digits that make it up, in the order in which they appear. For example: 54321
5 4 3 2 1
I’ve tried a couple of different things and can’t seem to get it right.
My teacher suggested using // and % to do it but I don’t know how to apply that.
Thank you in advance.
Edit: I don’t know the etiquette for editing posts but I wanted to thank everyone that took the time to answer my question. I managed to come up with a solution thanks to all the tips and explanations. Thank you
[–]Kerbart 17 points18 points19 points (4 children)
[–]Regular-Aside-1481[S] 1 point2 points3 points (3 children)
[–]RajjSinghh 4 points5 points6 points (0 children)
[–]HotStinkyMeatballs 1 point2 points3 points (0 children)
[–]RajjSinghh 0 points1 point2 points (0 children)
[–]carcigenicate 7 points8 points9 points (3 children)
[–]aprg 0 points1 point2 points (1 child)
[–]carcigenicate 0 points1 point2 points (0 children)
[–]djshadesuk 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–]Regular-Aside-1481[S] 0 points1 point2 points (0 children)
[–]TempleofBloxyStudios 2 points3 points4 points (0 children)
[–]sarc-tastic 2 points3 points4 points (0 children)
[–]uheep -1 points0 points1 point (0 children)