How to write a program that reads a positive integer number and then prints each box on a line? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to write a program that reads a positive integer number and then prints each box on a line?

How to write a program that reads a positive integer number and then prints each box on a line? Conditions: The number from 0 to 10000. For example: Input. 2000. 9878 Outputs. 2. 9 0. 8 0. 7 0. 8

7th Nov 2019, 8:13 AM
Razan
Razan - avatar
6 Answers
+ 2
Did you give it a try? If not please do and if yes then please share with us what don't you understand.
7th Nov 2019, 8:35 AM
Avinesh
Avinesh - avatar
+ 2
either convert the integer to String and print each character using an for-loop or use the modulo-(remainder after division) and division-operator. you do modulo 10 and print the result and then divide the integer by ten as long as the integer is greater 0.
7th Nov 2019, 8:36 AM
Anton Böhler
Anton Böhler - avatar
+ 1
Razan this community is here to help people like you so whenever you request an answer, please try that by yourself and if still you are not getting it then there are a lot of people who will come for help.
7th Nov 2019, 8:46 AM
Avinesh
Avinesh - avatar
+ 1
ok thank you Avinesh
7th Nov 2019, 8:48 AM
Razan
Razan - avatar
0
No i didn’t try it Avinesh
7th Nov 2019, 8:42 AM
Razan
Razan - avatar
0
ok thank you Anton Böhler
7th Nov 2019, 8:43 AM
Razan
Razan - avatar