From 5a99e02a875c1cf19f56352d0f3cc5f212005930 Mon Sep 17 00:00:00 2001 From: Prashant Chand Date: Wed, 14 Nov 2018 07:54:02 +0530 Subject: [PATCH] Add the syntax "For infinite loop " (#21382) * Add the syntax "For infinite loop " * Shifted additions around to be less confusing --- guide/english/c/for/index.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/guide/english/c/for/index.md b/guide/english/c/for/index.md index fc14e0463a..a5d385f724 100644 --- a/guide/english/c/for/index.md +++ b/guide/english/c/for/index.md @@ -23,7 +23,7 @@ The initialization statement is executed only once. Then, the test expression is The for loop is commonly used when the number of iterations is known. -## Example +#### Example ```c #include @@ -37,7 +37,7 @@ int main () { } ``` -## Output: +#### Output: ```shell > Item on index 0 is 1 > Item on index 1 is 2 @@ -88,3 +88,12 @@ main () +## Syntax of For infinite loop + +```c +for ( ; ; ) { + statement(s); +} +``` + +An infinite loop occurs when the condition will never be met, due to some inherent characteristic of the loop. An infinite loop also called an endless loop, and it is a piece of coding that lacks a functional exit so that it repeats indefinitely.