php mcq questions with answers


                                

If a procedure fun() is to receive an int, a Single & a double and it is to return a decimal then which of the following is the correct way of defining this procedure?

A.fun(int i, Single j, double k) decimal { ... }
B.static decimal fun(int i, Single j, double k) { ... }
C.fun(int i, Single j, double k) { ... return decimal; }
D.static decimal fun(int i, Single j, double k) decimal { ... }
E.A procedure can never return a value.
                                

If a function fun() is to receive an int, a Single & a double and it is to return a decimal then which of the following is the correct way of defining this function?

A.decimal static fun(int i, Single j, double k) { ... }
B.decimal fun(int i, Single j, double k) { ... }
C.static decimal fun(int i, Single j, double k) { ... }
D.static decimal fun(int i, Single j, double k) decimal { ... }
E.static fun(int i, Single j, double k) { ... return decimal; }
                                

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.

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

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.
                                

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