Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

HOW TO HANDLE EXCEPTIONS IN C

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


Please Help Members By Posting Answers For Below Questions

Does c have function or method?

991


What are 'near' and 'far' pointers?

1031


What is #define?

1101


What is spaghetti programming?

1123


What is wild pointer in c?

1066


What does dm mean sexually?

1301


What are the types of pointers in c?

1018


Explain what is the difference between #include and #include 'file' ?

1018


all c language question

2430


Write a program to swap two numbers without using a temporary variable?

1116


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

1104


What are the different file extensions involved when programming in C?

1244


What is table lookup in c?

1093


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1055


What is variable in c example?

1056