Export (0) Print
Expand All

FOR Loops

Visual Studio .NET 2003

Each language offers a FOR statement; C/C++ has the most flexibility for expressions.

Visual FoxPro BASIC
FOR n = 1 TO 10
 ? n
ENDFOR
For n = 1 to 10
 Print n
Next n
Pascal C/C++
for n := 1 to 10 do
  writeln(n);
for(n=1; n<11; n++)
 printf("%d\n",n);

See Also

Assignment Statements | Case Sensitivity | CASE Statements | Comments | IF Statements | Parameter Passing by Reference | Parameter Passing by Value | Variable Declaration | WHILE Loops

Show:
© 2014 Microsoft