How does two nested for loop works

row=1, then condition will be checked, if condition is true it will enter the block
2ndly,
if the condition is true control moves to the inner for loop where col=1 and again condition will be checked, if condition true it will be entered inside

and value of row will be printed then col value will be incremented col++ and again condition will be checked if it false the control again moves to upper for loop and incremented value of the row, row++ and step moves till the upper condition get false.

Leave a Comment

Your email address will not be published. Required fields are marked *

To Resolve this issue at just 5$ from ServerExpert

https://serverexpert.io/

For Hosting please visit Hostingwebsite.io

You have Successfully Subscribed!

Open chat