madina1575
Posted on November 5, 2024
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)
}
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
Posted on November 5, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.