DEV Community

Firdavs Mukhsimov
Firdavs Mukhsimov

Posted on

Loops (for, while, do while)

a)for looping sintaksisi qanday? Misol keltiring.

for(boshlang'ich qiymat; shart; qadam)
{
    // Takrorlanuvchi kodlar
}
Enter fullscreen mode Exit fullscreen mode

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

while == birinchi tekshiradi kein qiladi;
do while == birinchi qiladi kein tekshiradi;
Enter fullscreen mode Exit fullscreen mode

c)Quyidagi kodning natijasini ayting:

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

Top comments (0)