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 access specifier in c#?

1014


What is ulong in c#?

997


Can you mark static constructor with access modifiers?

932


Are value types sealed?

938


What is session c#?

929


how to sort an array in c#

953


How to sign an assembly with strong name?

956


What is token in c#?

928


What is the difference between field and property in c#?

890


What is ienumerable t in c#?

821


Explain the use of SN.exe

1045


What is the difference between Object and class adapters?

918


What is cli in c#?

894


How will you deploy the dll file in gac?

898


Can we make a Static Constructor Parameterized? Give Reason with your answer

937