Current .Net Version: 1.1.4322
Home
Articles
Practice C# Online
C# Reference
XML Web Services
RSS Feeds
T-SQL Scripts
Videos
Valuable Links
Contact Us
Mike's C#, VS.NET and SQL Blog
ROR XML Info.
C# Reference
The world's largest C# Language & Framework Class Library Reference Database (second only to Microsoft's)!
Language Reference:
Language Search:
Framework Class Library Reference:
Framework Class Library Search:

for
Is a:Statement Keyword
Applies to Version:C# 1.0 and later
Namespace:N/A
Assembly:N/A (N/A)
Description:Executes a statement continuously until a specified expression evaluates to false.
Syntax:
for ([initializers]; [expression]; [iterators]) statement
Example(s):for (int i = 0; i <= 100; i ++) { // this block will get executed 101 times. } // i ++ is the iterator // you can have more than one iterator defined IF // more than one initializer is also defined // there is only 1 initializer in this loop: int i = 0; // you could also do this: for (int x=0, y=1, z=2; z >= x && y <= 2 && x <= y; x ++) { // this block will be executed 2 times }
 
COPYRIGHT/DISCLAIMER | CONTACT US