updated code parts for increased compatibility (#19621)

pull/25740/head
Thomas Papapaschos 2018-10-23 16:49:32 +03:00 committed by Kristofer Koishigawa
parent 98d125f5f5
commit 4d0fad6e75
1 changed files with 7 additions and 5 deletions

View File

@ -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;
}
```