edited by
245 views
1 votes
1 votes
  1. How to differentiate between Lexical, semantic and syntax error from a given code snippet.
  2. Why is this lexical error and not syntax error? 
    $ y = 0x5i; $
edited by

1 Answer

1 votes
1 votes
This number is start with 0 and we know octal no is start with 0 and (0 to 7 numbers are only allowed here) but here x,i written that's why it shown error in Lexical phase. It's not indentifying as Token.

Related questions

5 votes
5 votes
2 answers
3
nakshatra asked Dec 11, 2015
3,821 views
What is the difference in between lexical, syntax and semantic errors?Please give appropriate example also.
4 votes
4 votes
2 answers
4
jatin khachane 1 asked Nov 23, 2018
1,289 views
int main() { int a,b; a=10; b=15; printf("a=%d,b=%d",a++,b ); }The number of tokens in the above C program is_________.I am getting 30The answer given is 29