Fixed the formatting in all blocks of code (#34095)
* Fixed the formatting in all blocks of code * Update index.md
This commit is contained in:
committed by
The Coding Aviator
parent
5810a2cf41
commit
d03f332de5
@ -6,8 +6,7 @@ This is just like the `while` and `for` loop but the only difference is that the
|
|||||||
|
|
||||||
The `do while` loop has the following form:
|
The `do while` loop has the following form:
|
||||||
```cpp
|
```cpp
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
// do something;
|
// do something;
|
||||||
} while(condition);
|
} while(condition);
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ Do something first and then test if we have to continue. The result is that the
|
|||||||
|
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <iostream.h>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@ -33,12 +32,10 @@ Do something first and then test if we have to continue. The result is that the
|
|||||||
|
|
||||||
cin >> howmuch;
|
cin >> howmuch;
|
||||||
counter = 0;
|
counter = 0;
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
counter++;
|
counter++;
|
||||||
cout << counter << '\n';
|
cout << counter << '\n';
|
||||||
}
|
} while (counter < howmuch);
|
||||||
while ( counter < howmuch);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user