C Language Exercise Class – Day 27

01

C Language Exercise Class - Day 27

The semicolon is a separator between C statements, not a part of the statement

(True/False)

C Language Exercise Class - Day 27

Answer: False

Explanation: The semicolon is an essential part of the statement.

02

C Language Exercise Class - Day 27

The curly braces “{” and “}” can only serve as delimiters for function bodies

(True/False)

C Language Exercise Class - Day 27

Answer: False

Explanation:

Uses of curly braces:

Delimiters for functions

Delimiters for compound statements

Definitions of structures, enumerations, unions

Initialization lists, etc.

03

C Language Exercise Class - Day 27

Each line in a C program can only contain one statement

(True/False)

C Language Exercise Class - Day 27

Answer: False

Explanation: Omitted

04

C Language Exercise Class - Day 27

The execution of a C program always starts from the main function and ends at the end of the main function

(True/False)

C Language Exercise Class - Day 27

Answer: True

Explanation: Omitted

05

C Language Exercise Class - Day 27

The execution of a C program always starts from the main function and ends in the last function of the program

(True/False)

C Language Exercise Class - Day 27

Answer: False

Explanation: Omitted

06 (Common Mistake)

C Language Exercise Class - Day 27

++(i+1); is an illegal assignment statement

(True/False)

C Language Exercise Class - Day 27

Answer: True

Explanation: ++ can only operate on variables, not on expressions.

++ is the increment operator, which has two forms: prefix (e.g., ++i) and postfix (e.g., i++).

Operand requirements: The operand of ++ must be a modifiable lvalue, meaning it must be a variable or a writable storage location.

i+1 is an expression whose result is a temporary value (rvalue), which cannot be modified, thus ++(i+1) is illegal.

07

C Language Exercise Class - Day 27

Hyphens cannot appear in user identifiers, but underscores can

(True/False)

C Language Exercise Class - Day 27

Answer: True

Explanation: Omitted

08

C Language Exercise Class - Day 27

Underscores can appear in user identifiers, but cannot be placed at the beginning of the user identifier

(True/False)

C Language Exercise Class - Day 27

Answer: False

Explanation: Omitted

09

C Language Exercise Class - Day 27

In C language, Area and area are different identifiers

(True/False)

C Language Exercise Class - Day 27

Answer: True

Explanation: Omitted

10

C Language Exercise Class - Day 27

In C language, int a=b=0; is a correct definition statement

(True/False)

C Language Exercise Class - Day 27

Answer: False

Explanation: Omitted

Leave a Comment