Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we return two values from a function?

Answer Posted / tarun kumar

yes.
for example:
public int Add(int a,int b,out int c)
{
c=a+1;
return a+b;
}
when we call the Add method we will get the sum of the a
and b and can also use the value of c
like
int d=0;
int e= Add(2,3,d) ;
then the value of e will be 5 and the value of d will be 3.

Is This Answer Correct ?    9 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a cs file?

1035


What is event and delegates in c#?

1036


What is dataadapter c#?

937


What is the symbol used for in c#?

996


How do you create empty strings in c#?

982


What is difference between private and protected in c#?

1050


Define a manifest in .net?

1059


What is the correct way of declaring an xml namespace?

863


How to open a new form on button click in Windows forms?

1014


Why should you override the tostring() method?

1088


What are collections in c#?

944


How do you mark a method obsolete?

1046


What are the boolean data types in c#?

1062


Define strong name in c#?

981


What do you mean by shared assembly?

1095