Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-iter-10.cs
1 using System;
2 using System.Collections.Generic;
3
4 class Test
5 {
6         static IEnumerable<int> FromTo (int from, int to)
7         {
8                 while (from <= to) yield return from++;
9         }
10
11         public static int Main ()
12         {
13                 IEnumerable<int> e = FromTo (1, 10);
14
15                 int i = 0;
16                 foreach (int x in e) {
17                         foreach (int y in e) {
18                                 i += y;
19                                 Console.Write ("{0,3} ", x * y);
20                         }
21                         Console.WriteLine ();
22                 }
23                 
24                 Console.WriteLine (i);
25                 if (i != 550)
26                         return i;
27                 
28                 return 0;
29         }
30 }