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
How to compare array with pointer in c?
What is the explanation for the dangling pointer in c?
What are types of structure?
What are structures and unions? State differencves between them.
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What is an auto variable in c?
Can main () be called recursively?
What is indirection?
Why we use stdio h in c?
What is clrscr in c?
What Is The Difference Between Null And Void Pointer?
What is file in c language?
write a program to find out prime number using sieve case?
What is the difference between void main and main in c?
What are disadvantages of C language.