What is the use of 'for' statement in C# programming language?

 Posted by Goud.Kv on 9/1/2014 | Category: C# Interview questions | Views: 1586 | Points: 40
Answer:

for is an iteration statement that executes the entire block repeatedly like do statement without using any other statements like while.

Example,
for (int i = 1; i < 9; i++)

{
Console.WriteLine(i); // This will print from 1 to 8
}


Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response