for loop contains the starting point that is i=0, we can have any starting point as per our requirement.
second part is condition, when for loop will break.
third one is increment, what increment should program follow.
Example:
- using System; class ForLoop { public static void Main() { for (int i=0; i < 20; i++) { if (i == 10) break; if (i % 2 == 0) continue; Console.Write("{0} ", i); } Console.WriteLine(); } }
0 comments:
Post a Comment