Posts

Showing posts with the label Difference




Explain Difference Between Do-while and While Loop With Example

Image
While loops checks the condition frist then and executes the statement whereas do while loop will execute the statement at least once thence the conditions is checked. It is known as entry controlled loop. Do While Loop In C Full Explanation With Examples And Tutorials While loop checks the condition first and then executes the statements. . It is known as exit controlled loop. While i 10. Condition is checked later. Thus it is an example of a type of Exit Control Loop. Unlike the while loop which tests the condition before the code within the block is executed the do-while loop is an exit-condition loop in the sense that the code must always be executed first and then the expression or test condition examined. Even if the condition fails for the first time itself. The do-while loop executes the body and then evaluates number 10 until number 10 is false. It is also known as an exit-controlled loop. In a nu...