+ 1
"Hello" should print in the console
Depending on user input "e" in "Hello" should be added in the output sentence. Ex:if user input is 4,den in the console "Heeeello" should print, how can i do this. Help to come out of this.
4 Antworten
+ 4
You print always H and you ask user for e number and do a for from 1 to number where you print e's and next print llo
+ 4
@Daniel mentioned a 'for' loop. You could also use 'while'.
If you wanted to look at SoloLearn's training, loops are covered in SoloLearn's Java training, the second module: "Conditionals and Loops".
If you want code examples to adapt to your purpose, you can search CodePlayground:
Choose "Most Recent", and "Java", then type "loop" and choose any sample.
+ 1
How can i do that in code