What punctuation is used to start and end a code block in C?

Enhance your programming skills with the RECF Programming Test. Features flashcards and multiple choice questions with hints and explanations. Prepare for success!

Multiple Choice

What punctuation is used to start and end a code block in C?

Explanation:
Code blocks in C are marked by curly braces. An opening curly brace starts the block, and the corresponding closing curly brace ends it. This is how the compiler knows which statements belong together—such as the body of a function, an if/else section, or a loop—and it also defines the scope of any variables declared inside that block. Other punctuation serves different roles: parentheses group expressions and enclose function arguments; square brackets access array elements; angle brackets are used with include directives to reference header files. So the punctuation that starts and ends a code block is the curly brace.

Code blocks in C are marked by curly braces. An opening curly brace starts the block, and the corresponding closing curly brace ends it. This is how the compiler knows which statements belong together—such as the body of a function, an if/else section, or a loop—and it also defines the scope of any variables declared inside that block. Other punctuation serves different roles: parentheses group expressions and enclose function arguments; square brackets access array elements; angle brackets are used with include directives to reference header files. So the punctuation that starts and ends a code block is the curly brace.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy