fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Test
  6. {
  7. public static string[] firstNames = {"Mark", "Mike" };
  8. public static string[] lastNames = {"Watson", "Wilson"};
  9.  
  10. public static void Main (string[] args)
  11. {
  12.  
  13. var fullnames =
  14. from fn in firstNames
  15. from ln in lastNames
  16. select new { Fullname = fn + " " + ln };
  17.  
  18. foreach(var person in fullnames) {
  19. Console.WriteLine (person.Fullname);
  20. }
  21.  
  22. }
  23. }
Success #stdin #stdout 0.04s 36976KB
stdin
1
2
10
42
11
stdout
Mark Watson
Mark Wilson
Mike Watson
Mike Wilson