- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Create a Quadruple Tuple in C#
Quadruple is a tuple with four items.
<T1,T2,T3,T4>
Create a tuple first.
var myTuple = Tuple.Create(100, 200, 300, 400);
Above, we have created a tuple with four items i.e. Quadruple. Now to access all the four items.
myTuple.Item1 myTuple.Item2 myTuple.Item3 myTuple.Item4
Example
using System; public class Program { public static void Main() { var myTuple = Tuple.Create(100, 200, 300, 400); Console.WriteLine("Item1 : "+ myTuple.Item1); Console.WriteLine("Item2 : "+ myTuple.Item2); Console.WriteLine("Item3 : "+ myTuple.Item3); Console.WriteLine("Item4 : "+ myTuple.Item4); } }
Output
Item1 : 100 Item2 : 200 Item3 : 300 Item4 : 400
Advertisements