.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Linq;
					
public class Program
{
	public static void Main()
	{
		int[] integerList1 = new[] { 1, 12, 4, 5, 78 };
		int[] integerList2 = new[] { 1, 42, 75, 65, 8, 97 };
		
		var result = (from a in integerList1
					  join b in integerList2 on (a % 10) equals (b % 10)
					  select new NumberPair { Item1 = a, Item2 = b }
					  )
						.OrderBy(x => x.Item1)
						.ThenBy(x => x.Item2)
						.ToList();
		
		/* Alternate
		var result = integerList1.Join(integerList2,
									   x => x % 10,
									   y => y % 10,
									   (x, y) => new { x, y })
									.Select(x => new NumberPair { Item1 = x.x, Item2 = x.y })
									.OrderBy(x => x.Item1)
									.ThenBy(x => x.Item2)
									.ToList();
		*/
		
		foreach (var item in result)
		{
			Console.WriteLine(String.Format("Item1: {0}, Item2: {1}", item.Item1, item.Item2));	
		}
	}
}

public class NumberPair
{
	public int Item1  { get; set; }	
	public int Item2  { get; set; }
}
;