Advertisements
Advertisements
प्रश्न
Give two differences between Syntax error and Logical error.
फरक स्पष्ट करा
उत्तर
S. No. | Syntax error | Logical error |
1. | Errors occur when programming principles or grammar are not followed correctly. | Errors occur when software logic is not planned correctly. |
2. | All syntax problems should be recognised and repaired. Otherwise, the software won't run. | The computer is not aware that an error has occurred. The software executes, but the output may be incorrect. |
3. | Example: x = a + b The above statement generates a syntax error due to a missing semicolon at the end. |
To print numbers from 1 to 10,
The code above contains a logical mistake as the intended output requires x <= 10.
|
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?