Interview Questions   Tutorials   Discussions   Programs   

C - How many error occurs in C language ?




315
views
asked marvit August 18, 2014 09:12 AM  

How many error occurs in C language ?


           

1 Answers



 
answered By bhjahnavi   0  
There are three types of errors — syntax, logical, and run-time errors.  
1. Syntax errors: These errors occur because of wrongly typed statements, which are not according to the syntax or grammatical rules of the language.
For example, in C, if you don’t place a semi-colon after the statement . it results in a syntax error.
printf(“Hello,world”) – error in syntax (semicolon missing) printf("Hello,world"); - This statement is syntactically correct.  
2.  Logical errors: These errors occur because of logically incorrect instructions in the program. Let us assume that in a 1000 line program, if there should be an instruction, which multiplies two numbers and is wrongly written to perform addition. This logically incorrect instruction may produce wrong results. Detecting such errors are difficult.
3.  Run time errors: These errors occur during the execution of the programs though the program is free from syntax and logical errors. Some of the most common reasons for these errors are
when you instruct your computer to divide a number by zero.
when you instruct your computer to find logarithm of a negative number.
when you instruct your computer to find the square root of a negative integer.
4. Linking Error: These errors are occurs due to the linking of header files to the current program.
Unless you run the program, there is no chance of detecting such errors
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert