How many error occurs in c language




















Basically there are three types of errors in c programming: Runtime Errors Compile Errors Logical Errors C Runtime Errors C runtime errors are those errors that occur during the execution of a c program and generally occur due to some illegal operation performed in the program.

Examples of some illegal operations that may produce runtime errors are: Dividing a number by zero Trying to open a file which is not created Lack of free memory space It should be noted that occurrence of these errors may stop program execution, thus to encounter this, a program should be written such that it is able to handle such unexpected errors and rather than terminating unexpectedly, it should be able to continue operating.

Compile Errors Compile errors are those errors that occur at the time of compilation of the program. C compile errors may be further classified as: Syntax Errors When the rules of the c programming language are not followed, the compiler will show syntax errors.

For example, consider the statement, int a,b: The above statement will produce syntax error as the statement is terminated with : rather than ; Semantic Errors Semantic errors are reported by the compiler when the statements written in the c program are not meaningful to the compiler. Yap really good one….. This will surely help out me during my exam!! Leave a Reply Cancel reply Your email address will not be published. A logic error is an error in the way a program works. The program can run but does not do what it is expected to do.

Logic errors can be caused by the programmer:. Unlike a syntax error, a logic error does not usually stop a program from running. The program will run, but not function as expected. A runtime error is an error that takes place during the running of a program. In that case, it will show desired output. This kind of error occurs when it is syntactically correct but has no meaning. This is like grammatical mistakes. If some expression is given at the left side of assignment operator, this may generate semantic error.

Smita Kapse. Previous Page Print Page. Next Page.



0コメント

  • 1000 / 1000