Can we return two values from a function?

Answer Posted / niks

I think yes.. Function can return multiple values.. It's
not good practice.. but C# allows you.. Consider following
example

int Val;
GetValue(Val);

bool GetValue(out int Val)
{
Val = value;
return true;
}

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a console application in c#?

437


What is the use of return in c#?

479


What is Reflection in .NET? Namespace? How will you load an assembly which is not referenced by current assembly?

513


Can a string be null c#?

487


How do I convert a string to an int in c#?

511






What is the difference between protected and private?

455


What is event delegate in c#?

569


What is a static field?

498


Why we use get set in c#?

486


what are the different ways a method can be overloaded?

512


What do you mean by saying a "struct is a value type"?

510


Do loops in c#?

491


Is c# used for any core features of windows vista?

507


What are the uses of delegates in c#?

565


what is IFormatable

572