exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 75 discussion

Actual exam question from Microsoft's 70-483
Question #: 75
Topic #: 2
[All 70-483 Questions]

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
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
When the C# compiler encounters an #if directive, followed eventually by an #endif directive, it will compile the code between the directives only if the specified symbol is defined. Unlike C and C++, you cannot assign a numeric value to a symbol; the #if statement in C# is Boolean and only tests whether the symbol has been defined or not. For example,
#define DEBUG
// ...
#if DEBUG
Console.WriteLine("Debug version");
#endif

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
renatofrancisco
Highly Voted 5 years, 5 months ago
The answer is B.
upvoted 10 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...