Answer Posted / chandan kiit
There is no try,catch(available in C++,java..) facility to
handle exception in C.but we can handle exception by
validating data come from outside into the program.
eg.. cosider this code
void main(){
int a,b,div;
scanf("%d,%d",a,b)
div=a/b;
printf("%d",div);
}
int this case , b might be zero that will generate an
exception.so we can avoid it by using if statement.
if(b==0)
print("plz enter non zero value");
In this manner only we can prevent exception in C..
Thank you
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
Does c have function or method?
What are 'near' and 'far' pointers?
What is #define?
What is spaghetti programming?
What is wild pointer in c?
What does dm mean sexually?
What are the types of pointers in c?
Explain what is the difference between #include and #include 'file' ?
all c language question
Write a program to swap two numbers without using a temporary variable?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What are the different file extensions involved when programming in C?
What is table lookup in c?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What is variable in c example?