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

How can I manipulate individual bits?

1099


What are the types of data files?

1252


What is an array? What the different types of arrays in c?

1254


When c language was developed?

1105


Why c is called procedure oriented language?

1107


What is int main () in c?

1128


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

1185


What are disadvantages of C language.

1222


In C language what is a 'dangling pointer'?

1242


What is the difference between scanf and fscanf?

1344


What are the characteristics of arrays in c?

1103


What is assignment operator?

1113


How do you generate random numbers in C?

1246


Is fortran still used today?

1150


In a switch statement, what will happen if a break statement is omitted?

1120