Computer Applications
Give two differences between Syntax error and Logical error.
Input in Java
169 Likes
Answer
Syntax Error | Logical Error |
---|---|
Syntax Errors occur when we violate the rules of writing the statements of the programming language. | Logical Errors occur due to our mistakes in programming logic. |
Program fails to compile and execute. | Program compiles and executes but doesn't give the desired output. |
Syntax Errors are caught by the compiler. | Logical errors need to be found and corrected by people working on the program. |
Answered By
98 Likes
Related Questions
What is a Runtime error? Explain with an example.
What are the different types of errors that take place during the execution of a program?
In an election, there are two candidates X and Y. On the election day, 80% of the voters go for polling, out of which 60% vote for X. Write a program to take the number of voters as input and calculate:
- number of votes received by X
- number of votes received by Y
A shopkeeper offers 10% discount on the printed price of a mobile phone. However, a customer has to pay 9% GST on the remaining amount. Write a program in Java to calculate the amount to be paid by the customer taking printed price as an input.