- Trending Categories
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
Return a C# tuple from a method
Firstly, create a tuple as shown below that calls a method.
var tuple = Show();
The above statement calls the following method −
static Tuple<int, int, int, int, int> Show()
Under the method, return the tuple as shown below −
Example
using System; public class Demo { public static void Main() { var tuple = Show(); Console.WriteLine(tuple.Item1); Console.WriteLine(tuple.Item2); Console.WriteLine(tuple.Item3); Console.WriteLine(tuple.Item4); Console.WriteLine(tuple.Item5); } static Tuple<int, int, int, int, int> Show() { return Tuple.Create(3, 5, 7, 9, 11); } }
Output
3 5 7 9 11
- Related Articles
- How to return 2 values from a Java method
- Return a 3-tuple for pickling a MaskedArray in Numpy
- How to return an array from a method in Java?
- Can we return this keyword from a method in java?
- How can we return null from a generic method in C#?
- Set tuple as a method parameter in C#
- Return mantissa and exponent as a pair of a given tuple in Numpy
- How can I subtract tuple of tuples from a tuple in Python?
- Return mantissa and exponent as a pair for a specific tuple element in Numpy
- Python Pandas - Return a tuple of the shape of the underlying data
- How can Tensorflow be used with Estimators to return a two element tuple?
- Can a method return multiple values in Java?
- Create Ennead Tuple from a List collection in Java
- Create Decade Tuple from a List collection in Java
- Create LabelValue Tuple from a List collection in Java

Advertisements