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?
  1. Function definitions cannot be nested.
  2. Functions can be called recursively.
  3. If we do not return a value from a function then a value -1 gets returned.
  4. To return the control from middle of a function exit function should be used.
  5. Function calls can be nested.
1, 2, 5
2, 3, 5
2, 3
4, 5
None of these
Answer: Option
Explanation:
No answer description is available. Let's discuss.

12.
How many values is a function capable of returning?
1
0
Depends upon how many params arguments does it use.
Any number of values.
Depends upon how many ref arguments does it use.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

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] + " ");
        }
    }
}
1 4.0 India B
1 4.0 India
1 4 India
1 India B
Answer: Option
Explanation:
No answer description is available. Let's discuss.

14.
How many values is a subroutine capable of returning?
Depends upon how many params arguments does it use.
Any number of values.
Depends upon how many ref arguments does it use.
0
1
Answer: Option
Explanation:
No answer description is available. Let's discuss.

15.
Which of the following CANNOT occur multiple number of times in a program?
namespace
Entrypoint
Class
Function
Subroutine
Answer: Option
Explanation:
No answer description is available. Let's discuss.