static void ReverseLinkedList1() { var obj = new CareerCupQnA(); var number1 = new myLinkedList <int> { data = 2, Next = new myLinkedList <int> { data = 5, Next = new myLinkedList <int> { data = 6 } } }; var res = obj.ReverseALinkedList(number1); while (res != null) { Console.WriteLine(res.data); res = res.Next; } }