retagged by
1,224 views

2 Answers

4 votes
4 votes

Yes, there is a lexical error. 

"Hello); is NOT a valid string literal.

1 votes
1 votes

The above statement has no Lexical error.

If you think about a lexer as a finite state machine that accepts valid input strings, then errors are going to be any input strings that do not result in that finite state machine reaching an accepting state.

Related questions

4 votes
4 votes
2 answers
2
jatin khachane 1 asked Nov 23, 2018
1,255 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
2 votes
2 votes
5 answers
3
Mizuki asked Nov 11, 2018
1,831 views
What it the number of tokens in the following line?printf("%d numbers.", &x);
1 votes
1 votes
2 answers
4
Lovejeet Singh asked Nov 7, 2018
1,185 views
How will the compiler detect whether "if" is a keyword or an identifier?Please tell me the concept behind this.