1 votes 1 votes 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. Compiler Design compiler-design compilation-phases + – Nihal Singh asked Oct 4, 2021 Nihal Singh 531 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 1 votes 1 votes 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. Aashay kaurav answered Oct 6, 2021 • selected Oct 8, 2021 by Nihal Singh Aashay kaurav comment Share Follow See 1 comment See all 1 1 comment reply Nihal Singh commented Oct 6, 2021 reply Follow Share Okay... Yeah And it changes the data type. If data type mismatch like this happens. Right ? 0 votes 0 votes Please log in or register to add a comment.