DEV Community

Mushtariy
Mushtariy

Posted on

while Loop

a) while loopdan foydalanib, foydalanuvchi ragam kiritgancha loopni davom ettirish kodini yozing (masalan, 0 kiritilganda loop tugaydi).

int num1 = 10;

while(num1 != 0)
{
   Console.WriteLine(num1);
}
Enter fullscreen mode Exit fullscreen mode

b) Quyidagi kodning natijasi nima bo'ladi?

int x = 10;

while (x > 0)
{
    Console. WriteLine(x);
    x -= 2;
}
Enter fullscreen mode Exit fullscreen mode

javob - 10,8,6,4,2

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

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

Okay