DEV Community

Sanjar Rashidov
Sanjar Rashidov

Posted on

3 2 1 2 2

while loop

Loop - halqa degani.
"While loop"ga bergan shartimiz noto'gri bo'lgunigacha "while loop"ga kiradi va berilgan ishni qayta bajaradi.

Syntax of while loop:
while(comdition)
{
statement
increament/decreament;(++/--)
}

Masalan:

#include <iostream>

using namespace std;

int main()
{
    int n = 1;

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

    return 0;
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up