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
What is size of union in c?
What is c value paradox explain?
Explain what is the difference between a free-standing and a hosted environment?
What is function prototype in c language?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What are the types of arrays in c?
What are structural members?
What does typedef struct mean?
What does c mean?
What does printf does?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
How can I make sure that my program is the only one accessing a file?
What is c standard library?
Explain indirection?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.