Incomplete info while explaining while loop (#22265)

This commit is contained in:
Shantanu Sharma
2018-11-18 18:44:27 +05:30
committed by Tom
parent dab81b7da9
commit 754384ebf9

View File

@ -37,7 +37,7 @@ int main(void) {
return 0; return 0;
} }
``` ```
While the statement within the while loop is true, the content within the brackets will be run. When the program hits the `while(my_number)`, it checks the statement within the parenthesis. If that statement is false, it won't run the while loop. Instead, it will skip over the code between the two brackets and will pick up where it left off. While the statement within the while loop is true, the content within the brackets will be run. When the program hits the `while(my_number!=10)`, it checks the statement within the parenthesis. If that statement is false, it won't run the while loop. Instead, it will skip over the code between the two brackets and will pick up where it left off.
If the statement is true, the code within the brackets will be run. Once the code within the brackets has run, the statement within the parenthesis will be checked again. Just like before, if the statement is true, the code will be run, if it's false, the code will be skipped. If the statement is true, the code within the brackets will be run. Once the code within the brackets has run, the statement within the parenthesis will be checked again. Just like before, if the statement is true, the code will be run, if it's false, the code will be skipped.