0

How to understand nested loops?

I have been programming in C for quite a while now. But when it comes to create logic for loops, I'm not that good. Nested loops is what makes things confusing for me...Any help will be appreciated.

26th Jul 2018, 2:35 PM
Avinash Suresh
1 Odpowiedź
+ 1
Avinash Suresh to explain: when a loop is inside a loop, the step in the outside loop will execute when the entire loop on the inside is done. essentially, if you have a loop that does something m times and you have a loop inside it that does something n times, the action inside the deeper loop will be executed n*m times. hope this helps
26th Jul 2018, 7:14 PM
hinanawi
hinanawi - avatar