Answer Posted / chandan
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 ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is a pragma?
What is "Hungarian Notation"?
What is sizeof in c?
how can f be used for both float and double arguments in printf? Are not they different types?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What is the condition that is applied with ?: Operator?
Explain the use of bit fieild.
Here is a neat trick for checking whether two strings are equal
What is enumerated data type in c?
How old is c programming language?
What is the difference between array_name and &array_name?
What do you mean by command line argument?
What is a struct c#?
Why should I use standard library functions instead of writing my own?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none