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 are functions c#?
What is namespace in oop?
What is arraylist?
What is the use of table aliases?
Explain the difference between abstract class and interface in .net?
What is a event in c#?
Why can't we use a static class instead of singleton?
Explain about CTS?
Is hashset ordered c#?
What is meant by unicode characters?
What floating point types is supported in C#?
How can you read 3rd line from a text file?
What is difference between throw and throws in c#?
Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?
How do you clear a list in c#?