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

Are c# references the same as c++ references?

945


What are access modifiers in c#?

939


What is a view? What is the use of it?

1017


Differentiate between method overriding from method overloading with its functionality?

954


What is difference between ienumerable and iqueryable in c#?

877


Explain the differences between static, void and public in c#?

960


why delegate is type safe?

2952


What are the Types of caching

965


How does foreach loop work in c#?

900


What is routing in c#?

840


What is the use of return in c#?

884


Does a class need a constructor c#?

855


What does static mean in c sharp?

990


Does c# support a variable number of arguments?

945


Write a program in C# for checking a given number is PRIME or not.

1020