Functions and Subroutines

Q1: If a function fun() is to sometimes receive an int and sometimes a double then which of the following is the correct way of defining this function?

A
static void fun(object i)
{ ... }

B
static void fun(int i)
{ ... }

C
static void fun(double i, int j)
{ ... }

D
static void fun(int i, double j)
{ ... }

E
static void fun(int i, double j, )
{ ... }

ANS:A -

static void fun(object i)
{ ... }

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.