Facebook

nesting loops

Nesting of loops

Loops can be nested if required.Nesting means to have one or more loops inside the main loop. Syntax of nested for loops for(initialization;condition;iteration) { for(……) { for(…) {… } ……. } } Syntax of nested while loops while(condition) { ….. while(condition) { …….. } …. } Syntax of nested do-while loop do { statements; …… read more »

Sidebar