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

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


Please Help Members By Posting Answers For Below Questions

What are the usage of pointer in c?

1245


Can you think of a logic behind the game minesweeper.

2521


What is bubble sort technique in c?

1039


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

2469


What is d'n in c?

1176


What is the difference between typedef struct and struct?

1167


What are the different types of objects used in c?

1083


Explain the properties of union. What is the size of a union variable

1248


What is the best style for code layout in c?

1146


Explain how to reverse singly link list.

1205


Difference between pass by reference and pass by value?

1214


Differentiate between new and malloc(), delete and free() ?

1236


What is a structure and why it is used?

1294


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1191


How do I determine whether a character is numeric, alphabetic, and so on?

1186