From d8861ab98acc512623cedc28b6a8f3b69280d623 Mon Sep 17 00:00:00 2001 From: Akshat Tripathi Date: Mon, 26 Nov 2018 15:54:01 +0530 Subject: [PATCH] added a small statement (#23119) * added a small statement * Fixed formatting --- guide/english/cplusplus/do-while-loop/index.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guide/english/cplusplus/do-while-loop/index.md b/guide/english/cplusplus/do-while-loop/index.md index b41670dc13..f4f09d744b 100644 --- a/guide/english/cplusplus/do-while-loop/index.md +++ b/guide/english/cplusplus/do-while-loop/index.md @@ -2,8 +2,9 @@ title: do while loop --- ## Do While Loop +This is just like the `while` and `for` loop but the only difference is that the code in its body is executed once before checking the condition. -The `do while loop` is almost the same as the while loop. The `do while loop` has the following form: +The `do while` loop has the following form: ```cpp do { @@ -18,7 +19,9 @@ Note: Remember to use a semicolon ';' at the end of the condition. The do-while loop is used whenever you are sure that a particular process(within the loop) has to be performed at least once. It has many advantages like not initializing the checking variable(eg- char addmore='Y') etc. The semicolon at the end of while is a must. -Do something first and then test if we have to continue. The result is that the do block runs at least once. (Because the expression test comes afterward). Take a look at an example: +Do something first and then test if we have to continue. The result is that the do block runs at least once. (Because the expression test comes afterward) . Take a look at an example: + + ```cpp #include