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
6 Antworten
+ 2
Did you give it a try? If not please do and if yes then please share with us what don't you understand.
+ 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.
+ 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.
+ 1
ok thank you Avinesh
0
No i didn’t try it Avinesh
0
ok thank you Anton Böhler