adplus-dvertising
frame-decoration

Question

What is the output for the following 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: (b).Sachin Tendulkar

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output for the following code ?