Which code should you use?

You need to write a console application that meets the following requirements:
• If the application is compiled in Debug mode, the console output must display Entering debug mode.
• If the application is compiled in Release mode, the console output must display Entering release mode.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D

microsoft-exams

3 thoughts on “Which code should you use?

  1. None of these are correct. D is not the correct answer since RELEASE has not been defined. RELEASE is not a predefined constant in Visual Studio. Should just be

    #if (DEBUG)
    Console.WriteLine(“Entering debug mode”);
    #else
    Console.WriteLine(“Entering release mode”);
    #endif

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.