DO WHILE LOOP

madina1575

madina1575

Posted on November 5, 2024

DO WHILE LOOP

do while loop - while loopning bir turi.

do while loop ham while loop bilan bir xil funksiyani bajaradi ammo while loop agar sharti to'g'ri bo'lmasa ichiga kirmaydi, do while loop da sharti to'g'ri bo'masa ham bir marta ishlaydi.

Sinteks:
do
{
statement;
increasment/decreasment;
}while(expression)

Masalan:

#include <iostream>

using namespace std;

int main()
{
    int i = 15;
    do
    {
        cout << "Hello World" << endl;
        i++;
    }while(i <= 10)
}
Enter fullscreen mode Exit fullscreen mode

bu yerda i 15 ga teng yani 10dan katta va shartga to'g'ri kelmaydi ammo u bir marta Hello World tekstini chiqarib beradi.

💖 💪 🙅 🚩
madina1575
madina1575

Posted on November 5, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

NESTED WHILE LOOP
beginners NESTED WHILE LOOP

November 5, 2024

DO WHILE LOOP
beginners DO WHILE LOOP

November 5, 2024

ELSE IF
beginners ELSE IF

November 5, 2024

NESTES IF
beginners NESTES IF

November 5, 2024

FUNCTIONS
beginners FUNCTIONS

November 5, 2024