Errors in C


Hello today we are going to learn about the arrows in the C program and how to find them remove them Fixed time so that we can Run java program without an error removing an error is very important in C programming as it shows your debugging skill.

c4fun brings you air those which are commonly encountered in the C programming


Whenever we try to perform the programming we always make error in it, there are different types of error which you would encounter in the c language

v  Syntax Error

v  Runtime error

v  Logical error

v  Input data  error



Errors are a type of illegal operations performed by the user which make an abnormal working of the program.

Errors often remain undetected until we compile it .some error may be resolve on compiling but there are some which are hidden and would not make your program perform the task you are expecting it to perform.
here c4fun brings you a list of all errors generally we would encounter while we are in learning phase of our basic language as we would learn by time these errors would be removed from your code and do remember practice make it all complete, otherwise there are still many who are not even able to remove the simple errors!


Syntax Error: the errors which arise due to violation of any rule or regulations of c language during the development of program,
for example:


#include<stdio.h>
#include<conio.h>
Void main()

{
while(.)
{
printf("hello");
}
}



Runtime Error: the error which occurs during the execution of a program. Those errors are termed as a runtime error.
for example:
#include<stdio.h>
#include<conio.h>
Void main()

{
    int n =9,div=0;
   s= n/div;
    printf("%d",s);
}



Logical Error: the error which is introduced due to a usage of wrong logic or expression in a program. These errors are called as a logical error.
for example:


#include<stdio.h>
#include<conio.h>
Void main()


{
int i,n;
for(i=0;i<9;i++);
{printf("hello world");
}
}
semicolon  after the for loop,error will arrise.


Input data Error: the error which occurs during the data entry process because of entering wrong input values, after the execution of the program.


Linker error: the error which occurs after compiling, we link different object files with main, using the run command these errors are generated when the executable file can't be generated!

The reason behind it may be the wrong prototyping !, an incorrect header file.the most common and likely to occur error by the student is the wite Main()
In place of main().



Semantic error: have you written something which does not make sense, these type of error occur when you have written something which does not make sense to the compiler.here sense is the meaningful sentence you want him to execute.


For example

#include<stdio.h>
#include<conio.h>
Void main()
{
Int a,b,c;
A+b=c;
}
Here the error which generated is semantic error



Hope you have gone through the block and now would be able to fix the errors you would be facing in the C programming share this blog among your friends and relatives so that they may also clearly understand the different errors they might have encountered in their programming.
Remember sharing is caring this is the concept of our block C4fun




Dude comment the errors you have encountered till now in your programming drop in the comment section let's make a change of the address you have encountered and we'll see how you behave debugging it......

No comments

thanks for reading and sharing.I hope it would help you!!!!

Powered by Blogger.