Control Variable Scope and Logic Using Code Blocks in c#

hello to everyone.currently i 'm learning foundational c# for certification! there is somthing wrong with this question ; i don’t agree with the answer of the exercice

Hi @vanleroy53, welcome to the FCC forum! :slight_smile:

The first two options suggest the removal of curly brackets for code blocks. Here, code blocks refer to groupings of one or more statements in a program. However, it’s important to clarify that we cannot remove curly braces in code blocks for if statements. The third option, ‘Always choose a style that improves readability,’ suggests that when dealing with a code block, we must keep curly braces, while in the case of a single line, their removal can enhance readability.
I think this is the reason the third one was right.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.