ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Select the output for the following set of code?

        static void Main(string[] args)

        {

            int a =5, b =;

            if (Convert.ToBoolean(Convert.ToInt(++a)) || Convert.ToBoolean(Convert.ToInt(++b)))

            {

                Console.WriteLine(a + "\\n" + b);

            }

            else

                Console.WriteLine(" C# ");

 

        }

user-image
تم إضافة السؤال من قبل Mohannad Bakbouk , Full Stack Web Developer , Almohtaseb
تاريخ النشر: 2016/10/19
Anas Elmadhoon
من قبل Anas Elmadhoon , Full Stack Asp.net Web Developer , Freelancer

Appear error says: Invalid expression term from b=;

"b" needs to init value.

 

Thank you so much for invitation for answer.

Anas

Mohammad Nadir Roshan
من قبل Mohammad Nadir Roshan , Technical Support Specialist , FreeBalance Co

There are three major problem with code.

1. "Invalid term expression": meaning the variable 'b' need to be initialized (given a value).

2. "Convert.ToInt" is not recognized in C# and it should be "Convert.ToInt"

3. "\\n" is not correct to get a new line and it should have only one backslash

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟