Compiler Design · Lexical Analysis
Official IIT answer key · IIT Roorkee · Audited Aug 2026
GATE CSE 2026 Set 1 Q27 · MSQ · 1 mark
char *str1 = "Hello; /* Statement S1 */
char *str2 = "Hello;"; /* Statement S2 */
int *str3 = "Hello"; /* Statement S3 */
Which of the following options is/are correct?Key concept
No account needed
Sit 5 related Lexical AnalysisPYQs as a guest. We'll score the set and show which traps cost marks — sign in only if you want to save the run.
Topic notes
Lexical Analysis in GATE CS is consistently tested as a 1-mark foundational topic covering tokenization mechanics, formal automaton models, error classification, and compiler data structure lifecycle. Recent years have shifted from purely definitional phase-matching questions toward practical token segmentation using the maximal munch rule and formal construction of NFA/DFA models from regular expressions.
Full Lexical Analysis guide →Consider the following C statements: char *str1 = "Hello; /* Statement S1 */ char *str2 = "Hello;"; /* Statement S2 */ int *str3 = "Hello"; /* Statement S3 */ Which of the following options is/are correct?
Topic-wise GATE CS PYQs with verified steps
Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.
