DEV Community

Mushtariy
Mushtariy

Posted on

do while loop

a) do while loop qachon ishlatiladi?

Biz cheksiz yoki 1 narsani ko'p marta yozishimiz kerak bo'lganida.

b) Quyidagi kodning natijasini tushuntiring

int i = 5;

do
{
    Console.WriteLine(i);
    i++;
}while(i < 5);
Enter fullscreen mode Exit fullscreen mode

natija 5 chiqadi lekin bu xato chunki i 5 ga teng va loopda i 5 dan kichkina bo'lguncha chiqarish kerak.

Top comments (0)

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

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

Okay