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 access specifier in c#?
What is ulong in c#?
Can you mark static constructor with access modifiers?
Are value types sealed?
What is session c#?
how to sort an array in c#
How to sign an assembly with strong name?
What is token in c#?
What is the difference between field and property in c#?
What is ienumerable t in c#?
Explain the use of SN.exe
What is the difference between Object and class adapters?
What is cli in c#?
How will you deploy the dll file in gac?
Can we make a Static Constructor Parameterized? Give Reason with your answer