C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Return more then one value by using Tuple
WhatsApp
Abrar Ahmad Ansari
Mar 11
2015
928
0
0
//Return value more then one by using Tuple
using
System;
using
System.Collections.Generic;
using
System.Data.SqlClient;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
ConsoleApplication1
{
class
Program
{
public
Tuple<
string
,
int
,
string
> ReturnMorethenOneValue()
{
return
new
Tuple<
string
,
int
,
string
>(
"Abrar Ahmad Ansari"
, 25,
"Bangalore"
);
}
static
void
Main(
string
[] args)
{
var objTuple =
new
Program().ReturnMorethenOneValue();
Console.WriteLine(
"Name: "
+ objTuple.Item1);
Console.WriteLine(
"Age: "
+ objTuple.Item1);
Console.WriteLine(
"City: "
+ objTuple.Item1);
Console.ReadLine();
}
}
}
C#