Facebook

nesting loops

For Loops

It’s easy and quick to print a name one time or two times. But what if we want to print same name 1000 times? What if we want to print a table of a number? What if we want to print a similar pattern again and again? In order to solve these questions and in… read more »

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