What are the different types of errors in C and when they occur?
Answers were Sorted based on User's Feedback
Answer / pavan_mustyala
1. Syntax Errors: Error found during compilation e.g.
missing semi colon, missing comma, undeclared identifier,
etc
2. Semantic Errors: Logical error in the program due to
which functionality behaves differently than expected.
3. Runtime Errors: Exceptions due to insufficient memory
and Segmentation fault, stack over flow, etc.
Is This Answer Correct ? | 70 Yes | 12 No |
Answer / sivavendra
compilation errors(occurs during compilation) and runtime errors(occurs during runtime)...
Is This Answer Correct ? | 27 Yes | 9 No |
Answer / vishwjeet singh
PROTOTYPE ERROR:when any header file is missing then we error hat was shown by compilling the program is prototype error.
SYNTEX ERROR: Actually these type of errors occured when
programmer misses the syntax.(Syntsx: (,),(.),(;),("") etc.)
Example:- printf("your sum is %d"c);
This may occure error "Syntax error".
Right Syntax is:printf("your sum is %d",c);
SYSTEMATIC ERROR:These type of errors occure when there is a
missmatch of functionallity.
Example: int sum is;
this may occure error because while declaring a variable c
is not allowed space( ).
Right Syntax is: int sum_is;
RUNTIME ERROR: Thes etype of errors also known as "linker
errors".These type of errors occure after compilation.This
will not give you the line where these type of errors occured.
Is This Answer Correct ? | 22 Yes | 4 No |
Answer / sudhir seth
Syntax errors: Actually these type of errors occured when
programmer misses the syntax.(Syntsx: (,),(.),(;),("") etc.)
Example:- printf("your sum is %d"c);
This may occure error "Syntax error".
Right Syntax is:printf("your sum is %d",c);
Symmentic errors:These type of errors occure when there is a
missmatch of functionallity.
Example: int sum is;
this may occure error because while declaring a variable c
is not allowed space( ).
Right Syntax is: int sum_is;
Runtime errors: Thes etype of errors also known as "linker
errors".These type of errors occure after compilation.This
will not give you the line where these type of errors occured.
Is This Answer Correct ? | 22 Yes | 9 No |
Write down the difference between c. Loop and goto statement d. (!0) and (!1) e. (1= =! 1) and (1!=1) f. NULL and !NULL
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }
#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); }
main() { char c; for(c='A';c<='Z';c++) getch(); }
Declaration of Cube Guys please help me.. Is this a right way to declare cube.? If i Compile it. It Says: Cube undeclared what should i do? Please help \thanks in advanced #include<stdio.h> #include<math.h> #include<conio.h> main( ) { float x,y; while(x++<10.0) { printf("Enter Number:"); scanf("%d", &x); y = cube(x); printf("%f %f %f \n", x,pow(x,2),y); cube(x); } { float x; float y; y = x*x*x; } getch(); return (y); }
Assume that the int variables i and j have been declared, and that n has been declared and initialized. Write code that causes a "triangle" of asterisks of size n to be output to the screen. Specifically, n lines should be printed out, the first consisting of a single asterisk, the second consisting of two asterisks, the third consistings of three, etc. The last line should consist of n asterisks. Thus, for example, if n has value 3, the output of your code should be * ** *** You should not output any space characters. Hint: Use a for loop nested inside another for loop.
full c programming error question based problem
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
What are the different types of errors in C and when they occur?
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;
void main() { int i=5; printf("%d",i+++++i); }
write a profram for selection sort whats the error in it?