221k views
3 votes
Which error produces incorrect results but does not prevent the program from running? a. syntax b. logic c. grammatical d. human e. None of the above

1 Answer

5 votes

Answer:

Logic Error

Step-by-step explanation:

I'll answer the question with the following code segment.

Program to print the smallest of two integers (written in Python)

num1 = int(input("Num 1: "))

num2 = int(input("Num 2: "))

if num1 < num2:

print(num2)

else:

print(num1)

The above program contains logic error and instead will display the largest of the two integers

The correct logic is

if num1 < num2:

print(num1)

else:

print(num2)

However, the program will run successfully without errors

Such errors are called logic errors

User Sdepold
by
6.0k points