 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Program to access tuple elements
Create a tuple.
var myTuple = Tuple.Create(1, 2.5M, "Amit", "100");
Now to access tuple elements, use the properties.
To access first element.
myTuple.Item1
To access second element.
myTuple.Item2
In the same way, for other elements, use the properties as shown below −
Example
using System; public class Program {    public static void Main() {       var myTuple = Tuple.Create(1, 2.5M, "Amit", "100");       Console.WriteLine("Item1 : "+ myTuple.Item1);       Console.WriteLine("Item2 : "+ myTuple.Item2);       Console.WriteLine("Item3 : "+ myTuple.Item3);       Console.WriteLine("Item4 : "+ myTuple.Item4);    } }  Output
Item1 : 1 Item2 : 2.5 Item3 : Amit Item4 : 100
Advertisements
 