Answer :
A cause of a logical error if you are attempting to compare x to 5 if (x - 5). Hence option 1 is correct.
What is logical error?
Logical error is defined as a mistake in the source code of a program that results in unexpected and incorrect behavior. This is the error that happens when a computer language's syntax rules are broken. This typically occurs when we alter the intended syntax for writing the tokens or characters in the sequence.
The code will be run by the software, but unexpected outcomes will occur. By performing a dry run, using a trace table, or setting breakpoints to help locate the specific part of code that has the logic error, logic faults are typically fixed.
Thus, a cause of a logical error if you are attempting to compare x to 5 if (x - 5). Hence option 1 is correct.
To learn more about logical error, refer to the link below:
https://brainly.com/question/28957248
#SPJ1