Hello sir, Good afternoon! i am happy to get the help from you. for that thanku very much.
but now i need help in the for loop.

*
* *
* * *
* * * *
* * * * *
here is the picture, i want the coding of this program in c language and want to know
that how is the working of i and j loop. please sir explain in details.
if you will help me, i will be thankful to you for this.

Recommended Answers

All 2 Replies

We are not here for doing any one's homework. You have to write the code on your own.
However for the logic part there will be two loops i and j
i loop is for row, and j loop is for column.
Hope you know about matrix, just figure out the sample star:-
when i=1 one loop for j; print star
when i=2 two loops for j; print star for every loop of j
when i=3 three loops for j; print star for every loop of j
and so on..
think like this and try to code it..if still you will get error then post your code along with errors , we will definitely help you.

You will need two loops, one inside the other. The outer most loop counts the rows, then the innermost loop counts the number of starts to be printed on each row. The innermost loop will count from the 0 up to, and including the value of the outermost loop.

Your assignment I assume is to teach you how to write loops, so I'm not going the give you actual code. Instead, you take your best shot at programming and post your attempt along with specific questions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.