This project is read-only.
For Loops

Category:
For and While Loops
Description: Some simple nested 'for' loops
Code:
let SampleForLoop3() =
for i in 0 .. 9 do
for j = 0 to i-1 do
printfn " "
for j = i to 9 do
printfn "%d" j
printfn ""

Execution Result:
0
1
2
3
4
5
6
7
8
9


1
2
3
4
5
6
7
8
9



2
3
4
5
6
7
8
9




3
4
5
6
7
8
9





4
5
6
7
8
9






5
6
7
8
9







6
7
8
9








7
8
9









8
9










9


Last edited Sep 14, 2011 at 3:35 AM by ttliu2000, version 1

Comments

No comments yet.