Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{  
    int a = 5;
    if (Convert.ToBoolean((.002f) -(0.1f)))
    Console.WriteLine("Sachin Tendulkar");
    else if (a == 5)
    Console.WriteLine("Rahul Dravid");
    else
    Console.WriteLine("Ms Dhoni");
    Console.ReadLine();
}

A. Rahul Dravid

B. Sachin Tendulkar

C. Ms Dhoni

D. Warning : Unreachable Code

Answer: Option B


Join The Discussion

Related Questions on Control Flow Statements in C Sharp