Update index.md (#28796)
Added an Example where the while loop gets ignored.
This commit is contained in:
committed by
The Coding Aviator
parent
e72caaa534
commit
13709bf178
@@ -51,6 +51,28 @@ value of a: 18
|
||||
value of a: 19
|
||||
```
|
||||
|
||||
Example of Skipped Loop Body:
|
||||
```C++
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
//Local variable declaration
|
||||
int age=10;
|
||||
|
||||
//while loop execution
|
||||
while(age>21) {
|
||||
cout<<"The citizen is an adult."<<endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
### Sources
|
||||
- www.tutorialspoint.com
|
||||
* www.tutorialspoint.com
|
||||
|
Reference in New Issue
Block a user