+ 1
Loop structure
Like # # # # # #
7 odpowiedzi
+ 3
Kesaba Khuntia:
1. write a for() loop that executes three times.
2. Each time through the loop, print one more '#' than the previous time.
There are a number of ways to do step 2. Here are some ideas:
- build a string, adding '#' each time through the loop
- use a nested loop where the inner loop prints '#' a number of times based on the outer loop index
- create an array of strings like {'#", "##", "###"} and print the string at the current loop index.
- create a string like "###" and use a printf() field width format specifier that limits how many characters to print based on the loop index.
+ 3
Kesaba Khuntia
So What is your question?
we are all not able to complete your homework.
if you facing any problem,then share your attempt?
+ 3
Kesaba Khuntia I listed four ideas for how to add increasing numbers of '#' characters. Any one of them would work. The last one is the simplest.
+ 2
To use the nested loop idea, set the inner loop range to go from 0 up to the outer loop index value.
0
#
##
###
Like loop structure making code in C
0
But how to increase the no.of # as the loop execution going on
0
In nested loop how to increase #