Back to Freecodecamp

Control Variable Scope and Logic Using Code Blocks in C#

curriculum/challenges/english/blocks/add-logic-to-c-sharp-console-applications/647e21658acb466c97ccbee2.md

latest1.4 KB
Original Source

--description--

This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:

  1. Go to <a href="https://learn.microsoft.com/training/modules/csharp-code-blocks/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/csharp-code-blocks/</a> and complete all the tasks for the "Control Variable Scope and Logic Using Code Blocks in C#" module. This is required to earn the "Add Logic to C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
  2. When you are finished, come back and correctly answer the question below.

--assignment--

Complete the <a href="https://learn.microsoft.com/training/modules/csharp-code-blocks/" target="_blank" rel="noreferrer">Control Variable Scope and Logic Using Code Blocks in C#</a> module on Microsoft Learn. Then, answer the question below.

--questions--

--text--

Which of the following statements is true about showing/removing the curly braces for code blocks associated with an if statement?

--answers--

The curly braces can't be removed from the code block for else if and else statements.


If the curly braces are removed from the code blocks of an if-elseif-else, the white space must also be removed.


Always choose a style that improves readability.

--video-solution--

3