1,217 views
1 1 vote

What is the earliest stage compiler error for the following C code snippet:

int x = @33;
  1. Lexical Error
  2. Syntax Error
  3. Semantic Error
  4. None

2 Answers

Best answer
3 3 votes

Answer: Option A) Lexical Error

The compiler will show a lexical error because of the "@" symbol in $@33$. It is not a valid character for variable assignment in the C programming language.  An identifier can only have alphanumeric characters (a-z , A-Z , 0-9) (i.e. letters and digits) and underscore $(\_)$ symbol.

• selected by
1 1 vote
The earliest stage compiler error for the given C code snippet is a lexical error. This is because @ is not a valid token in the C language, so the compiler would detect it as a lexical error at the very beginning of the compilation process.
Position:
Show:

Related questions

0 0 votes
0 0 answers
1.0k
1.0k views
rahul sharma 5 asked May 2, 2018
1,000 views
Consider the following set of codewords(Last bit is even parity of the first two bits)000011101110Now here min. hamming distance is 2 and if i apply formulaeMin. hamming...
2 2 votes
1 1 answer
647
647 views
0 0 votes
0 0 answers
6.1k
6.1k views
Nishi Agarwal asked Mar 17, 2019
6,068 views
23: We need a dataword of at least 11 bits. Find the values of k and n in the Hammingcode C(n, k) with dmin :3. Soln: We need to find k = 2m −1 − m ≥ 11. We use trial an...
3 3 votes
0 0 answers
5.8k
5.8k views
Nishi Agarwal asked Mar 17, 2019
5,836 views
32: A sender needs to send the four data items Ox3456, OxABCC, Ox02BC, and OxEEEE. Answer the following:a. Find the checksum at the sender site.b. Find the checksum at th...