give One example of logical error
Answers
Answered by
1
ANSWER:
- assigning a value to the wrong variable.
======What is Logical error?:=====
logic error is a bug in a program that causes it to operate incorrectly, but not to terminate abnormally. A logic error produces unintended or undesired output or other behaviour, although it may not immediately be recognized as such.
Answered by
0
a= 5;
b=4;
if (a == b)
{
printf (" a is greater");
}
else
{
printf(" b is greater");
}
Explanation:
here , when we write a == b , means we were testing is both values are same or not.
but we want which one have greatest value.
we use wrong operator means wrong logic.
Similar questions