what is logical error and syntax error ? plz explain in simple language.
Answers
Answered by
3
Answer:
Logical error is nothing but when we get an error in the logic written in code will give as logical error.
While coming to syntax error it means while if wont give the semicolons or braces correctly shows as syntax errors.
Explanation:
eg: we take program of even numbers
public static void Even(int n)
{
if(n%5==0)
System.out.println("Even");
else
System.out.println("Odd");
}
This program had logical error if we want to find it is even or not we should apply the logic if(n%2==0).
Similar questions
Geography,
6 months ago
Social Sciences,
6 months ago
Math,
6 months ago
Accountancy,
1 year ago
Biology,
1 year ago