C# | How to get Sixth Element of the Tuple? Last Updated : 30 Apr, 2019 Comments Improve Suggest changes Like Article Like Report Tuple is a data structure which gives you the easiest way to represent a data set which has multiple values that may/may not be related to each other. Item6 Property is used to get the sixth element of the given tuple. It is not applicable on 1-Tuple, 2-Tuple, 3-Tuple, 4-Tuple, and 5-Tuple but applicable on all other remaining tuples. Syntax: public T6 Item6 { get; } Here, T6 is the value of the current Tuple<> object's sixth component. This Tuple<> can be 6-tuple, or 7-tuple, or 8-tuple. Example: In the below code, you can see that we are accessing the sixth element of each tuple. CSharp // C# program to illustrate how to get // the sixth element of the tuple using System; class GFG { // Main method static public void Main() { // Taking 6-tuple var st6 = Tuple.Create("Riya", 24, "ME", 2015, "30-May-1991", 230134832); Console.WriteLine("Student-6 Contact No.: " + st6.Item6); // Taking 7-tuple var st7 = Tuple.Create("Rohit", 21, "IT", 2017, "21-Apr-1994", 384749829, 20000); Console.WriteLine("Student-7 Contact No.: " + st7.Item6); // Taking 8-tuple var st8 = Tuple.Create("Manita", 24, "CSE", 2013, "03-Aug-1991", 235678909, 34000, "C#"); Console.WriteLine("Student-8 Contact No.: " + st8.Item6); } } Output: Student-6 Contact No.: 230134832 Student-7 Contact No.: 384749829 Student-8 Contact No.: 235678909 Note: You can also get the type of the Sixth component of the tuple by using GetType() method or by using Type.GetGenericArguments method. Example: csharp // C# program to illustrate how to get the // type of the Sixth element of the tuple using System; class GFG{ // Main method static public void Main (){ // Taking 6-tuple var stu6 = Tuple.Create("Riya", 24, "CSE", 2015, 102, 230134832); Console.WriteLine("Student-6 Contact Number: "+stu6.Item6); // Get the type of Item6 // Using GetType() method Console.WriteLine("Type of Item6: "+stu6.Item6.GetType()); // Get the type of Item6 // Using Type.GetGenericArguments method Type stu6type = stu6.GetType(); Console.WriteLine("Type of Item6: "+stu6type.GetGenericArguments()[5]); Console.WriteLine(); } } Output: Student-6 Contact Number: 230134832 Type of Item6: System.Int32 Type of Item6: System.Int32 Comment More infoAdvertise with us Next Article C# | How to get Sixth Element of the Tuple? A ankita_saini Follow Improve Article Tags : C# CSharp-Tuple Similar Reads C# | How to get Seventh Element of the Tuple? Tuple is a data structure which gives you the easiest way to represent a data set which has multiple values that may/may not be related to each other. Item7 Property is used to get the seventh element of the given tuple. It is not applicable on 1-Tuple, 2-Tuple, 3-Tuple, 4-Tuple, 5-Tuple, and 6-tupl 2 min read How to get sixth Element of the ValueTuple in C#? ValueTuple is a structure introduced in C# 7.0 which represents the value type Tuple. It allows you to store a data set which contains multiple values that may or may not be related to each other. Item6 Property is used to get the sixth unnamed element of the given value tuple. It is applicable on e 2 min read C# | How to get Third Element of the Tuple? Tuple is a data structure which gives you the easiest way to represent a data set which has multiple values that may/may not be related to each other. Item3 Property is used to get the third element of the given tuple. It is not applicable on 1-Tuple, 2-Tuple but applicable on all other remaining tu 2 min read C# | How to get Second Element of the Tuple? Tuple is a data structure which gives you the easiest way to represent a data set which has multiple values that may/may not be related to each other. Item2 Property is used to get the second element of the given tuple. It is not applicable on 1-Tuple and applicable on all other remaining tuples. Sy 2 min read C# | How to get Fifth Element of the Tuple? Tuple is a data structure which gives you the easiest way to represent a data set which has multiple values that may/may not be related to each other. Item5 Property is used to get the fifth element of the given tuple. It is not applicable on 1-Tuple, 2-Tuple, 3-Tuple, and 4-Tuple but applicable on 2 min read Like