![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
C# Value Tuple
A value type representation of the C# Tuple is Value Type Tuple. It was introduced in C# 7.0.
Note − Add System.ValueTuple package to run ValueTuple program.
Let’s see how to add it −
- Go to your project
- Right click on the project in the Solution Explorer
- Select “Manage NuGet Packages”
- You will reach the NuGet Package Manager.
- Now, click the Browse tab and find “ValueTuple”
- Finally, add System.ValueTuple package
Example
using System; class Program { static void Main() { var val = (5, 50, 500, 5000); Console.WriteLine("Add System.ValueTuple package to run this program!"); if (val.Item2 == 50) { Console.WriteLine(val); } } }
Output
The following is the output.
(5, 50, 500, 5000);
Advertisements