The ones who are crazy enough to think they can change the world are the ones who do.- Steve Jobs
The do while loop evaluates the condition only after the execution of the statements in its body. The statements within the do-while loop executed at least once. A do while loop is also called as bottom tested loop.
Let us see how neat a syntax of do while loop is
do { statement 1; statement n; } while(test expression);
The following example program will clearly explain the concept of do while loop
#include <stdio.h> int main() { do { printf("I will display once "); } while(2 > 10); return 0; }
Although the test condition in the while loop may false for the very first time. The statements of do-while loop will be executed at least once.
We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.
© Copyright 2019