- 1
What Actually is a Loop in C# and what it does?
I didn't understood the script for loop, please give me an example for it and commands in detailed
2 Answers
0
Edit - in C#*
0
A loop is used to repeat executing a block of code.
For example, if you want to print numbers from 1 to 1000. You can achieve this with a loop:
int num = 1;
while(num <= 1000)
{
Console.WriteLine(num);
num++;
}