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>


This content originally appeared on DEV Community and was authored by Sanjar Rashidov

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;
}


This content originally appeared on DEV Community and was authored by Sanjar Rashidov


Print Share Comment Cite Upload Translate Updates
APA

Sanjar Rashidov | Sciencx (2024-11-02T10:55:51+00:00) Nested while loop. Retrieved from https://www.scien.cx/2024/11/02/nested-while-loop/

MLA
" » Nested while loop." Sanjar Rashidov | Sciencx - Saturday November 2, 2024, https://www.scien.cx/2024/11/02/nested-while-loop/
HARVARD
Sanjar Rashidov | Sciencx Saturday November 2, 2024 » Nested while loop., viewed ,<https://www.scien.cx/2024/11/02/nested-while-loop/>
VANCOUVER
Sanjar Rashidov | Sciencx - » Nested while loop. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/11/02/nested-while-loop/
CHICAGO
" » Nested while loop." Sanjar Rashidov | Sciencx - Accessed . https://www.scien.cx/2024/11/02/nested-while-loop/
IEEE
" » Nested while loop." Sanjar Rashidov | Sciencx [Online]. Available: https://www.scien.cx/2024/11/02/nested-while-loop/. [Accessed: ]
rf:citation
» Nested while loop | Sanjar Rashidov | Sciencx | https://www.scien.cx/2024/11/02/nested-while-loop/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.