19-05-2014, 03:42 PM
Errors
Errors.pptx (Size: 186.19 KB / Downloads: 17)
Introduction:-
Errors/bugs are very common while developing a program. If you don’t detect them and correct them, they cause a program to produce wrong results.
Types of errors:-
Syntex error
Logical error
Run time error
Latent error
LOGICAL ERROR
Logical errors :- These errors occur because of logically incorrect instructions in the program.
Example:-
(when x and y are float type values)
if(x== y)
printf(“ they are equal”);
COMMON PROGRAMMING ERROR
Missing semicolons :
a= x + y
b= m/n; //(yb = treated as variable name
Error msg: “undefined name”
Misuse semicolon:-
for(i=1;i<=10;i++);
sum= sum +i;
“only exit value of i is added to the sum”
Use of = instead of == :
if(code=1)
count++;