Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
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
909
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#
Up Next
Return more then one value by using Tuple