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
What is a cs file?
What is event and delegates in c#?
What is dataadapter c#?
What is the symbol used for in c#?
How do you create empty strings in c#?
What is difference between private and protected in c#?
Define a manifest in .net?
What is the correct way of declaring an xml namespace?
How to open a new form on button click in Windows forms?
Why should you override the tostring() method?
What are collections in c#?
How do you mark a method obsolete?
What are the boolean data types in c#?
Define strong name in c#?
What do you mean by shared assembly?