C# Programming - Functions and Subroutines - Discussion

Discussion :: Functions and Subroutines - General Questions (Q.No.12)


How many values is a function capable of returning?

[A]. 1
[B]. 0
[C]. Depends upon how many params arguments does it use.
[D]. Any number of values.
[E]. Depends upon how many ref arguments does it use.

Answer: Option A


No answer description available for this question.

Nirmal R said: (Jun 21, 2012)  
Function is capable of returning only one value..it may be int,double,byte or it may be a refernce type(obj)

John said: (Jul 15, 2012)  
What about the out keyword ?

Tipu said: (Mar 31, 2014)  
We can return multiple value from C# method if we use.

out keyword during passing parameters.

Anindita said: (Aug 29, 2017)  
I think the answer is E.

We can return multiple values from a function using the following 3 approaches:
Reference parameters.
Output parameters.
Returning an Array.
Returning an object of class/struct type.
Returning a Tuple.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.