VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/c-sharp-sharp-how-to-get-fifth-element-of-the-tuple/

⇱ C# | How to get Fifth Element of the Tuple? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C# | How to get Fifth Element of the Tuple?

Last Updated : 11 Jul, 2025
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 all other remaining tuples. Syntax:
public T5 Item5 { get; }
Here, T5 is the value of the current Tuple<> object's fifth component. This Tuple<> can be 5-tuple, or 6-tuple, or 7-tuple, or 8-tuple. Example: In the below code, you can see that we are accessing the fifth element of each tuple.
Output:
Student-5 DOB: 20-Mar-1993
Student-6 DOB: 30-May-1991
Student-7 DOB: 21-Apr-1994
Student-8 DOB: 03-Aug-1991
Note: You can also get the type of the fifth component of the tuple by using GetType() method or by using Type.GetGenericArguments method. Example:
Output:
Student-5 ID: 101
Type of Item5: System.Int32
Type of Item5: System.Int32
Comment
Article Tags:
Article Tags:

Explore