Basics of Loop:
while(condition){
statement;
}
do{
statement;
}while(condition);
for(initialize;condition;increment){
statement;
}
Nested Loops:
while(condition){
do{
statement;
}while();
statement;
}
do{
statement;
for(initialize;condition;increment){
statement;
}
statement;
}while(condition);
for(initialize;condition;increment){
while(condition)
{
statement;
}
statement;
}
Infinite loop:
Actually we use for loop here
for( ; ; )
{
statement; // it will run forever
}
Control Statement For The loops:
break;//it means stop
continue; //it means continue the next statements without these
goto statement; //jump to somewhere
//example goto zaki; zaki: cout<<"My name is zaki";