functions and subroutines questions

11.

Which of the following statements are correct about functions used in C#.NET?

Function definitions cannot be nested.
Functions can be called recursively.
If we do not return a value from a function then a value -1 gets returned.
To return the control from middle of a function exit function should be used.
Function calls can be nested.

A.     1, 2, 5
B.     2, 3, 5
C.     2, 3
D.     4, 5
E.     None of these
Answer & Explanation

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.
View Answer Workspace Report Discuss in Forum
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 & Explanation

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.
View Answer Workspace Report Discuss in Forum
13.

What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
object[] o = new object[] {“1”, 4.0, “India”, ‘B’};
fun (o);
}
static void fun (params object[] obj)
{
for (int i = 0; i < obj.Length-1; i++)
Console.Write(obj[i] + ” “);
}
}
}

A.     1 4.0 India B
B.     1 4.0 India
C.     1 4 India
D.     1 India B
Answer & Explanation

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Workspace Report Discuss in Forum
14.

How many values is a subroutine capable of returning?
A.     Depends upon how many params arguments does it use.
B.     Any number of values.
C.     Depends upon how many ref arguments does it use.
D.     0
E.     1
Answer & Explanation

Answer: Option D

Explanation:

No answer description available for this question. Let us discuss.
View Answer Workspace Report Discuss in Forum
15.

Which of the following CANNOT occur multiple number of times in a program?
A.     namespace    B.     Entrypoint
C.     Class    D.     Function
E.     Subroutine
Answer & Explanation

Answer: Option B

Explanation:

No answer description available for this question.

Leave a Reply0

Your email address will not be published.