Sail E0 Webinar
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); }
Options:
A .  35.78 10
B .  10 35.00
C .  10 35.78
D .  None of the mentioned
Answer: Option C


'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 ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers