From 4d0fad6e75fbbfcca79212914637aeb80adc156f Mon Sep 17 00:00:00 2001 From: Thomas Papapaschos Date: Tue, 23 Oct 2018 16:49:32 +0300 Subject: [PATCH] updated code parts for increased compatibility (#19621) --- guide/english/c/loops/index.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/guide/english/c/loops/index.md b/guide/english/c/loops/index.md index 97c8260fd6..14b4cd15d7 100644 --- a/guide/english/c/loops/index.md +++ b/guide/english/c/loops/index.md @@ -134,9 +134,9 @@ 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. ### Syntax Comparison -``` +```C -main() +int main() { int i = 1; while(i<=5) @@ -145,10 +145,11 @@ main() i++; } getch(); + return 0; } -main() +int main() { int i = 1; do @@ -157,11 +158,11 @@ main() i++; } while(i<=5); getch(); - + return 0; } -main() +int main() { int i for(i=1;i<=5;i++) @@ -169,6 +170,7 @@ main() printf(“for”); } getch(); + return 0; } ```