adplus-dvertising
frame-decoration

Question

Select the output for the following set of code :
static void Main(string[] args)
 {
     int i = 30;
     int j = 25 % 25;
     if (Convert.ToBoolean(Convert.ToInt32(i = j)))
     {
         Console.WriteLine("In if");
     }
     else
     {
         Console.WriteLine("In else");
     }
     Console.WriteLine("In main");
     Console.ReadLine();
 }

a.

In if

b.

In else

c.

In if
In main

d.

In else
In main

Posted under C# programming

Answer: (d).In else
In main

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Select the output for the following set of code :