Corrected markdown for example code (#30387)
The markdown used in the examples in the section titled Implementation had the closing back-ticks specified on the wrong line, causing the code examples to be incorrectly displayed.
This commit is contained in:
committed by
Christopher McCormack
parent
6f28548668
commit
91926b71fe
@ -59,8 +59,7 @@ The update statement is used to alter the loop variable by using simple operatio
|
|||||||
|
|
||||||
You will often see an increment operation as the update statement (e.g. i++, count++). This is often seen as one of the distinguishing features and possible name sources for the C++ language.
|
You will often see an increment operation as the update statement (e.g. i++, count++). This is often seen as one of the distinguishing features and possible name sources for the C++ language.
|
||||||
|
|
||||||
## IMPLEMENTATION:
|
## Implementation
|
||||||
|
|
||||||
```C++
|
```C++
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using std::cout; // Here we use the scope resolution operator to define the scope of the standard functions as std
|
using std::cout; // Here we use the scope resolution operator to define the scope of the standard functions as std
|
||||||
@ -95,14 +94,13 @@ The body of the for loop need not be enclosed in braces if the loop iterates ove
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
```c++
|
```c++
|
||||||
#include<iostream.h>
|
#include<iostream.h>
|
||||||
using std::cout;
|
using std::cout;
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
// Single line for loop
|
// Single line for loop
|
||||||
for( int a = 10; a < 20; a++ )
|
for( int a = 10; a < 20; a++ )
|
||||||
cout << "value of a: " << a << endl;
|
cout << "value of a: " << a << endl;
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user