Question
What is the output for the following set of code :
static void Main(string[] args) { int i = 10; double d = 35.78; fun(i); fun(d); Console.ReadLine(); } static void fun(double d) { Console.WriteLine(d); }
static void Main(string[] args) { int i = 10; double d = 35.78; fun(i); fun(d); Console.ReadLine(); } static void fun(double d) { Console.WriteLine(d); }
Answer: Option C
Was this answer helpful ?
'int' datatype is sub datatype of 'double'.Hence, when first part of func() is executed it is integer part and hence when second part is executed it is double.
Output:10
35.78
Was this answer helpful ?
Submit Solution