Introduction
I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability.
using System; using System.Linq; using System.Collections.Generic; class LinqExercise23 { public static void Main(string[] args) { char[] charlist = { 'A', 'B', 'C' }; int[] numlist = { 1, 2, 3 }; var cartesianProduct = from letterlist in charlist from numberlist in numlist select new { letterlist, numberlist }; Console.Write("The Cartesian Product are : \n"); foreach (var productItem in cartesianProduct) { Console.WriteLine(productItem); } Console.ReadLine(); } }