+1 vote
269 views

consider this c code:

wheil(1){
printf("hi");
}

will this code fragment gives lexical error or not. If not then who is responsible for this error.

| 269 views
0

No lexical error

https://gateoverflow.in/201833/lexical-syntax-and-semantic-error
check this answer for understanding lexical error

NO lexical error .

whiel will be treated as a function name ,hence a token is generated.so there is no lexical error .

it is a semantic  error becz we are colling a function which is not defined.

https://gateoverflow.in/165048/lexical-error

by Boss (35.7k points)
selected
+1 vote
No it is not lexical error. There will be no Syntax error as well, but there will be a semantic error because it does not recognize wheil.
by (129 points)