elibraryportal Logo

While Loop Statement in C++

In C++ while loop is first check the condition, if condition is true then control goes inside the loop body, other wise goes outside the body.

Example:-

Output:

1
2
3
4
5

Nested While Loop Statement in C++

Example:-

Output:

Enter the number of rows: 5
1
22
333
4444
55555