1.

Briefly explain logical error.

Answer»

As the name implies Logical errors are related to the logic of the program execution. Logical errors do not show compiler generated error messages rather they cause wrong results. These errors are primarily due to poor understanding the problem, incorrect translation of the algorithm into program and lack of clarity of hierarchy of operators. In the statement if(x= =y) printf(“They are equal\n”); when x and y are float type, they rarely become equal due to truncation errors. The printf may not be executed at all. Similarly test condition while(x!=y) might create an infinite loop.



Discussion

No Comment Found