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
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Why c is faster than c++?
swap 2 numbers without using third variable?
Explain the difference between strcpy() and memcpy() function?
Can a pointer be volatile in c?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What does double pointer mean in c?
find out largest elemant of diagonalmatrix
What is a scope resolution operator in c?
How many levels deep can include files be nested?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
a program that can input number of records and can view it again the record
What is the difference between class and object in c?