Not able to execute and know how while loop works

Wants to know how while loop works?
cst is incremented to 2 and nst also to 2 then how System.out.print("*"); prints 2 star in row 2

Hey @anktre7 nst i not incremented to 2 bcoz it is outside the brackets of while loop. So firstly while loop will be completed then nst will be incremented.And similar order will be followed for others row also.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like