From caaa78346be90879a03d3119ae0f929308d20229 Mon Sep 17 00:00:00 2001 From: Hardik Sharma <44233098+Shardic1@users.noreply.github.com> Date: Wed, 14 Nov 2018 20:22:45 +0530 Subject: [PATCH] Fixed some typos. (#26138) --- guide/english/cplusplus/for-loop/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guide/english/cplusplus/for-loop/index.md b/guide/english/cplusplus/for-loop/index.md index c92cedde469..dc2fd44b894 100644 --- a/guide/english/cplusplus/for-loop/index.md +++ b/guide/english/cplusplus/for-loop/index.md @@ -2,7 +2,7 @@ title: For Loop --- -A For Loop is a repetitive statement that is used to check for some condition and then based upon the condition a block of code is executed repeatedly until the specified condition is satisfied. +A For Loop is a repetitive statement that is used to check for some condition and then, based upon the condition a block of code, is executed repeatedly until the specified condition is satisfied. The for loop is distinguished from other looping statements through an explicit loop counter or loop variable which allows the body of the loop to know the exact sequencing of each iteration. @@ -110,10 +110,10 @@ value of a: 19 ``` ## Explanation -Here's the initialization condition is first set to a=10. The loop first checks for this condition. It then checks for the condition expression i.e a<20 which holds true as 10<20(for the first case). Now the body of the loop is executed and we get the output "Value of a: 10". Then the update expression is executed which adds the number 1 to 'a' and the value of 'a' gets updated to 11 and the same steps are followed (as above) until the value of v reaches less than 20 i.e 19. +Here, the initialization condition is first set to a=10. The loop first checks for this condition. It then checks for the condition expression i.e. a<20 which holds true as 10<20(for the first case). Now the body of the loop is executed and we get the output "Value of a: 10". Then the update expression is executed which adds the number 1 to 'a' and the value of 'a' gets updated to 11 and the same steps are followed (as above) until the value of v reaches less than 20 i.e 19. # Range-based for-loop -C++ also has what we call range-based for loops which iterates through all the elements of a container(e.g. array). +C++ also has what we call range-based for loops which iterates through all the elements of a container (e.g. array). ## Syntax