Question:medium

Which phase of a compiler checks variable declaration?

Show Hint

A program can be syntactically correct but semantically wrong. For example: int x; x = "hello"; is grammatically correct (Syntax), but semantically incorrect because you cannot assign a string to an integer.
Updated On: Jul 4, 2026
  • Lexical
  • Syntax
  • Semantic
  • Code generation
Show Solution

The Correct Option is C

Solution and Explanation

Was this answer helpful?
0

Top Questions on Regular expressions and finite automata