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

Write a c program to demonstrate character and string constants?

2181


Implement bit Array in C.

1133


How can a program be made to print the line number where an error occurs?

1080


What is identifiers in c with examples?

1168


What is the difference between procedural and functional programming?

1070


What is assignment operator?

1053


What are valid operations on pointers?

1191


What is the use of clrscr?

1099


Explain how can I pad a string to a known length?

1187


Differentiate Source Codes from Object Codes

1557


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16751


What is the size of empty structure in c?

1078


What is the use of the function in c?

1014


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

996


Explain the binary height balanced tree?

1178