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 ienumerable and iqueryable?
What can we do to handle multiple exceptions?
How do I trim a space in c#?
What is javascriptserializer c#?
What is the difference between selection and projection?
Is c# a strongly-typed language?
What is a destructor in c#?
What is code verification?
What is xpath in c#?
Is c# a technology?
What is tpl in c#?
What is the difference between static class and sealed class in c#?
How do I declare a pure virtual function in c#?
We cannot create instances of static classes. Can we have constructors for static classes?
What is data dictionary in c#?