Computer Science, asked by akashdeep1619, 1 year ago

Which of the following is an example of a logic error in programming?
A) Not using quotation marks and parentheses to print a string literal
B) Printing an inaccurate statement, like print("Dogs have wings.")
C) Trying to perform an impossible task, like 5 / 0
D) Using camelcase when a variable name contains two or more words

Answers

Answered by PSN03
3

its C cause the first one is syntax error.

Answered by Jasleen0599
0

Option C) Trying to perform an impossible task, like 5 / 0

Trying to perform an impossible task, like 5 / 0 is an example of a logic error in programming.

  • When a number is divided by zero, a logic software issue called division by zero usually results in a run-time error.
  • Division by 0 is undefinable in math. Because of this, when your code tries to use this undefined expression, Python will produce the error mentioned above.
  • A logical error is a mistake that produces an undesirable result. These errors, sometimes referred to as logical errors, are error-free but result in the erroneous output. Most beginners make mistakes of this nature. The developer's logical reasoning is mostly responsible for the incidence of these errors.
  • Logical Mistakes When specific input values are used, desired output cannot be produced after programme compilation and execution. Logical errors are those errors that produce wrong output but seem to be error-free.
  • A syntax error is a mistake that affects how a group of letters or tokens that are meant to be written in a specific computer language should be organised. A logical error is a programming error that affects how a programme behaves but does not result in an abnormal programme termination.

#SPJ2

Similar questions