Professional Documents
Culture Documents
Quiz 1 Answers
Quiz 1 Answers
1. Give a C language program fragment which will cause a lexical error during
lexical analysis. Justify your answer. (1 mark)
The use of any character (such as @, $ etc.) which is not defined by the C language
specifications will lead to a lexical error. Any code fragment containing such symbols is
an acceptable answer. Answers without proper justification will receive only 0.5 marks.
Answers correctly identifying BOTH tokens (a) and (b) will be awarded 1 mark. Similarly,
answers correctly identifying BOTH tokens (c) and (d) will be awarded 1 mark.