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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
main()

{

  int i, j, *p;

   i = 25;

   j = 100;

   p = &i; // Address of i is assigned to pointer p

  printf("%f", i/(*p) ); // i is divided by pointer p

}

a. Runtime error.

b. 1.00000

c. Compile error

d. 0.00000
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000
Answer
# 1
c) Error becoz i/(*p) is 25/25 i.e 1 which is int & printed
as a float,

 So abnormal program termination,

 runs if (float) i/(*p)   -----> Type Casting
 
Is This Answer Correct ?    0 Yes 0 No
Guest
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }  1
main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); }  1
String copy logic in one line. NetApp9
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O HCL2
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above HCL1
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }  1
Sorting entire link list using selection sort and insertion sort and calculating their time complexity NetApp1
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }  1
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }  1
main() { extern int i; i=20; printf("%d",sizeof(i)); }  1
main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513 HCL1
Write a routine that prints out a 2-D array in spiral order Microsoft2
main() { { unsigned int bit=256; printf("%d", bit); } { unsigned int bit=512; printf("%d", bit); } } a. 256, 256 b. 512, 512 c. 256, 512 d. Compile error HCL1
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }  1
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }  1
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }  1
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }  1
main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16 HCL1
Printf can be implemented by using __________ list.  1
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }  1
 
For more C Code 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