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
How can I manipulate individual bits?
What are the types of data files?
What is an array? What the different types of arrays in c?
When c language was developed?
Why c is called procedure oriented language?
What is int main () in c?
How do I determine whether a character is numeric, alphabetic, and so on?
What are disadvantages of C language.
In C language what is a 'dangling pointer'?
What is the difference between scanf and fscanf?
What are the characteristics of arrays in c?
What is assignment operator?
How do you generate random numbers in C?
Is fortran still used today?
In a switch statement, what will happen if a break statement is omitted?