3 3 votes Consider line number $\textbf{4}$ of the following C-program. int main() { /* Line 1 */ int value, result; /* Line 2 */ value = 100; /* Line 3 */ result = value @ 5; /* Line 4 */ printf("%d", result); /* Line 5 */ }Identify the compiler's response while creating the object-module:Only a syntactic error Only a semantic error Only a lexical error Both lexical and syntactic errors Compiler Design goclasses compiler goclasses-cs-dpp goclasses-cs-dpp-day-163 goclasses-compiler-practice-questions + – GO Classes 306 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
0 0 votes Analyzing Line 4: $\verb|result = value @ 5;|$When the compiler's lexical analyzer (scanner) reaches the character $\verb|@|$ in Line $4$, it attempts to group it with adjacent characters to form a valid C token:It checks if $\verb|@|$ is a valid single-character operator. It is not. It checks if it is part of a multi-character operator (like $\verb|==|$, $\verb|!=|$, etc.). It is not. Since the character $\verb|@|$ is not a valid character for forming any legal token in C (it is not part of an identifier, keyword, constant, or recognized operator), the scanner cannot classify it.This failure to recognize and generate a legal token occurs during the lexical analysis phase and is classified as a lexical error. GO Classes answered Dec 23, 2025 GO Classes comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes C JAY_THAKAR answered Jan 10 JAY_THAKAR comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes option c Aman Shukla answered Mar 21 Aman Shukla comment Share Follow 0 reply Please log in or register to add a comment.