DEV Community

madina1575
madina1575

Posted on

WHILE LOOP

loop -halqa dep tarjima qilinadi.

Looplar c++ dasturlash tilida biror ishni qayta qayta bajarish uchun ishlatiladi.

Looplardan biri bo'lgan while loop ni o'rganamiz.

Sinteks:

while(expression)
{
statement;
increasment/decreasment;
}

Masalan:

#include <iostream>

using namespace std;

int main()
{
    int i = 50;
    while(i >= 1)
    {
        cout << "Hello World" << endl;
        i--;
    }
}
Enter fullscreen mode Exit fullscreen mode

bu yerda i o'zgaruvchisi orqali Hello World tekstini 50 marta chop eta olamiz. While loop ga birinchi marta kirganda bitta Hello World tekstini chop etadi va bittaga kamayadi chunki i-- decreasment qo'yilgan.

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