From 88484876227682b381b4374506d859ade15df78f Mon Sep 17 00:00:00 2001 From: wolfwhocodes <40625914+wolfwhocodes@users.noreply.github.com> Date: Sun, 2 Dec 2018 08:22:31 +0530 Subject: [PATCH] Infinite for loop (#23252) * Infinite for loop A brief description of the infinite for loop was given along with an example. * Added syntax highlighting --- guide/english/c/loops/index.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/guide/english/c/loops/index.md b/guide/english/c/loops/index.md index 8e5000a268..07bf37633b 100644 --- a/guide/english/c/loops/index.md +++ b/guide/english/c/loops/index.md @@ -133,6 +133,15 @@ The next section is a boolean condition that will be checked for true or false, The final section is referred to as the 'increment/decrement'. Its job is to perform some operation every loop - usually adding or subtracting from the initial variable - after the code within the brackets has been run through. In this case, it's just adding one to the count. This is the most common way for the increment to be used, because it lets you keep count of how many times you've run through a for loop. + +An infinite loop is also possible in the for loop. An infinite for loop has absolutely no items in the paranthesis except for the two semi colons. + +```C +for(;;) { + printf("This will also get printed forever unless the program is stopped!"); +} +``` + ### Syntax Comparison ```C