ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
HOW TO HANDLE EXCEPTIONS IN C
 Question Submitted By :: Rakesh
I also faced this Question!!     Rank Answer Posted By  
 
  Re: HOW TO HANDLE EXCEPTIONS IN C
Answer
# 1
I prefer to get help in this matter.
 
Is This Answer Correct ?    0 Yes 0 No
Azhar Iqbal
 
  Re: HOW TO HANDLE EXCEPTIONS IN C
Answer
# 2
i can not handle exception in C.When exception occue in C 
the sustem will terminated.
 
Is This Answer Correct ?    1 Yes 0 No
Bhupendra
 
 
 
  Re: HOW TO HANDLE EXCEPTIONS IN C
Answer
# 3
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 ?    3 Yes 0 No
Chandan
 
  Re: HOW TO HANDLE EXCEPTIONS IN C
Answer
# 4
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 0 No
Chandan Kiit
 
  Re: HOW TO HANDLE EXCEPTIONS IN C
Answer
# 5
i feel perror would work for it.. 
please corect me if  i m wrong
 
Is This Answer Correct ?    0 Yes 0 No
Vrushali
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.  3
What is the most efficient way to count the number of bits which are set in a value?  3
Function to find the given number is a power of 2 or not? Motorola12
Describe advantages and disadvantages of the various stock sorting algorithms Microsoft1
without using arithmatic operator solve which number is greater??????????  1
What are the uses of pre-processor directives?  2
How many ways are there to swap two numbers without using temporary variable? Give the each logic.  6
i want to job in your company, so how it will be possible. TCS2
Hi, main() { } Is a user defined function or Built in Functionn Honeywell9
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } what is the output? Ramco7
How to write a code for random pick from 1-1000 numbers? The output should contain the 10 numbers from the range 1-1000 which should pick randomly, ie ,for each time we run the code we should get different outputs. NetApp12
related to rdbms query .  1
what is the hexidecimal number of 4100? Google14
what is the difference between declaration ,defenetion and initialization of a variable? LG-Soft5
How do you write a program which produces its own source code as its output?  2
#include<stdio.h> int SumElement(int *,int); void main(void) { int x[10]; int i=10; for(;i;) { i--; *(x+i)=i; } printf("%d",SumElement(x,10)); } int SumElement(int array[],int size) { int i=0; float sum=0; for(;i<size;i++) sum+=array[i]; return sum; } output? Ramco5
how to exchnage bits in a byte b7<-->b0 b6<-->b1 b5<-->b2 b4<-->b3 please mail me the code if any one know to rajeshmb4u@gmail.com Honeywell3
Give me basis knowledge of c , c++...  4
write a c program to accept a given integer value and print its value in words  3
what information does the header files contain? BSNL5
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com