Asked by Keilan Harris on Jun 23, 2024
Verified
____ is not a valid C statement.
A) struct {int month; int day; int year;} birth;
B) struct {int month; int day; int year;} birth, current;
C) struct Date {int month; int day; int year;};
D) struct {int month, int day, int year} birth;
Valid C Statement
A properly formatted and semantically correct command or instruction in the C programming language.
- Recognize correct and incorrect syntax in the declaration and initialization of structures.
Verified Answer
SS
shorouq shalabiJun 28, 2024
Final Answer :
D
Explanation :
The syntax error in option D is the use of commas instead of semicolons to separate the members of the struct. In C, struct members should be separated by semicolons.
Learning Objectives
- Recognize correct and incorrect syntax in the declaration and initialization of structures.