1.

Difference between while and do while

Answer» \tBASIS FOR COMPARISONWHILEDO-WHILEGeneral Formwhile ( condition) { statements; //body of loop }do{ . statements; // body of loop. . } while( Condition );Controlling ConditionIn \'while\' loop the controlling condition appears at the start of the loop.In \'do-while\' loop the controlling condition appears at the end of the loop.IterationsThe iterations do not occur if, the condition at the first iteration, appears false.The iteration occurs at least once even if the condition is false at the first iteration.Alternate nameEntry-controlled loopExit-controlled loopSemi-colonNot usedUsed at the end of the loop\t


Discussion

No Comment Found