in Compiler Design
514 views
1 vote
1 vote

According to the solution, there is no error in the program. And I ran the program there is no error. But how the rank is declared as int and initialized by 10.3 which is float. So, there should be a semantic error.

in Compiler Design
514 views

1 Answer

1 vote
1 vote
Best answer
No, there is no error in the code.

As rank has integer data type and initialized to 10.3

so, It will contain 10. Semantic error basically check weather the variable is declared or not before initialization.
selected by

1 comment

Okay... Yeah And it changes the data type. If data type mismatch like this happens. Right ?
0
0

Related questions