DEV Community

Sanjar Rashidov
Sanjar Rashidov

Posted on

3 2 2 1 2

Nested while loop

Nested while loop - while loop ichida yana boshqa while loop ishlatish.

Syntax of nested while loop:
while(condition)
{
while(condition)
{
statement
++/--
}
statement
++/--
}

Masalan:

#include <iostream>

using namespace std;

int main()
{
    int n = 1;

    while(n <= 1)
    {
        while(n <= 7)
        {
            cout << n << endl;
            n++;
        }
        cout << endl;
        n++;
    }

    return 0;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more