C# Programming - Functions and Subroutines
Exercise : Functions and Subroutines - General Questions
- Functions and Subroutines - General 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.
12.
How many values is a function capable of returning?
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] + " ");
}
}
}
14.
How many values is a subroutine capable of returning?
15.
Which of the following CANNOT occur multiple number of times in a program?
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers