DEV Community

Sanjar Rashidov
Sanjar Rashidov

Posted on

3 1 1 1 1

do while loop

Do while loop bu while loop bilan bir xil. Ammo "do while loop"ni sharti birinchi holda false bo'lsa ham dastur bir marta ishga tushadi.

Syntax of do while loop:
do
{
statement
++/--
}while(condition)

Masalan:

#include <iostream>

using namespace std;

int main()
{
    int n = 1;

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

    return 0;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay