C#

Loops in C# (for, while, do)

Në shqip: Ciklet në C#

ShpjegimiSQ

C#-i ka cikle for (me numërues), while (derisa një kusht është true), do-while (të paktën një herë) dhe foreach (për koleksione). break del nga cikli, continue kalon te hapi tjetër.

EnglishEN

C# has for loops (with a counter), while (as long as a condition is true), do-while (at least once) and foreach (for collections). break leaves the loop, continue skips to the next step.

Si ta mendosh

Si xhirot rreth fushës në stërvitje.

Lexoje në anglisht

Like laps around the pitch at training.

Shembull kodicsharp

for (int i = 1; i <= 5; i++) Console.WriteLine(i * 7);
int n = 100;
while (n > 1) n /= 2;

Terma të lidhur