Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Select the output for the following set of code?

      static void Main(string[] args)

        {

            int a =5, b =;

            if (Convert.ToBoolean(Convert.ToInt(0xB)))

                if (Convert.ToBoolean(Convert.ToInt()))

                    if (Convert.ToBoolean(Convert.ToInt('\\xeb')))

                        Console.WriteLine("java");

                    else ;

                else ;

            else ;

 

        }

 

a) Compile time error: Misplaced elseb) Compile time error: Undefined symbolc) javad) Warning: Condition is always true

user-image
Question added by Mohannad Bakbouk , Full Stack Web Developer , Almohtaseb
Date Posted: 2016/10/19
Brajpal Singh
by Brajpal Singh , System Analyst , Ebix Software India (P) Ltd.

a) Compile time error: For b =; because of (Invalid Expression)

b) Compile time error: For Convert.ToInt() because of Convert does not contain definition for ToInt().

Muhammad Jawad
by Muhammad Jawad , Deputy Manager (MIS) , AL-NOOR GROUP MDF BOARD

Expression is wrong because value is not int type

More Questions Like This