Logo

dev-resources.site

for different kinds of informations.

while loop

Published at
11/2/2024
Categories
cpp
programming
coding
beginners
Author
Sanjar Rashidov
Categories
4 categories in total
cpp
open
programming
open
coding
open
beginners
open
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;
}

Featured ones: