DEV Community

Mushtariy
Mushtariy

Posted on

Loops

a) for loopning sintaksisi qanday? Misol keltiring

for(int variable = son, variable = son yoki misol; increment or 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 I bo'lgan.

Top comments (2)

Collapse
 
asilbek_ibragimov_a0c27cc profile image
asilbek ibragimov

не бизадан кочирвоссила..????

Collapse
 
mushtariy profile image
Mushtariy

blmadmmmmmmmm