nested loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

nested loop

how do i write a program that asks a user for a number and uses that number to create a loop that increments asterisks( the asterisks are string values) for example, Enter number: 5 * ** *** **** *****

15th Sep 2021, 3:58 PM
Bobby Dike
Bobby Dike - avatar
6 Answers
15th Sep 2021, 4:33 PM
Rupali Haldiya
Rupali Haldiya - avatar
+ 1
rupali thanks, much appreciated
16th Sep 2021, 12:34 AM
Bobby Dike
Bobby Dike - avatar
+ 1
Bobby Dike you're welcome ☺️
16th Sep 2021, 2:50 AM
Rupali Haldiya
Rupali Haldiya - avatar
0
my main problem is how to increment a string value
15th Sep 2021, 4:22 PM
Bobby Dike
Bobby Dike - avatar
0
Bobby Dike "increment" the string: String s = "*"; s += "*"; System.out.println(s); // **
15th Sep 2021, 4:57 PM
Coding Cat
Coding Cat - avatar
- 1
Shivansh Soni that's a little bit to much for this simple example, isn't it? 😉
15th Sep 2021, 6:52 PM
Coding Cat
Coding Cat - avatar