Computer Science, asked by listener110, 1 year ago

what is logical error and syntax error ? plz explain in simple language.​

Answers

Answered by polavarapupavani1
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