GATE CS 2026 (Forenoon) — Question 27

Compiler DesignLexical Analysis & Parsing Architectures (LL(1), LR(1), LALR)MSQ1 markMedium

Consider the following C statements:
c
1char *str1 = "Hello;  /* Statement S1 */
2char *str2 = "Hello;"; /* Statement S2 */
3int *str3 = "Hello";   /* Statement S3 */
4
Which of the following options is/are correct?
  1. A
    S1 and S2 have syntactic errors
  2. B
    S2 has a lexical error and S3 has a syntactic error
  3. C
    S1 has a lexical error and S3 has a semantic error
  4. D
    S1 has a syntactic error and S3 has a semantic error
Practise the full 2026-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAPractise this subject in the exam simulatorTimed, GATE-style tests with analytics that find your weak topics.
Practise more on Lexical Analysis & Parsing Architectures (LL(1), LR(1), LALR)Timed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group