DEV Community

Sunnat Qayumov
Sunnat Qayumov

Posted on

3 3 3 3 3

6. Loops(for, while, do while)

*a) for loopning sintaksisi qanday? Misol keltiring
*

for(int variable = son, variable = son yoki misol; increment or 
Enter fullscreen mode Exit fullscreen mode

decrement;)

{
    -------------------------------------------------------;
}
Enter fullscreen mode Exit fullscreen mode

b) while loop va do while loop o'rtasida farq nima?

while loop - bu takrorlanuvchi blokni bajarish uchun ishlatiladigan sikl operatori.
C# dasturlash tilida do while sikli (do-while loop) ma'lum bir kodni kamida bir marta bajarishni ta'minlaydi va undan keyin shart tekshiriladi.

c) Quyidagi kodning natijasini ayting.

int i = 0;
while(i < 5)
{
    Console.WriteLine(i);
    I++;
}
Enter fullscreen mode Exit fullscreen mode

Xato chunki i kichkinada bo'lishi kerak.

Top comments (1)

Collapse
 
asilbek_ibragimov_a0c27cc profile image
asilbek ibragimov

харош

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

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

Okay