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       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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()

      {

       char *p;

       int *q;

       long *r;

       p=q=r=0;

       p++;

       q++;

       r++;

       printf("%p...%p...%p",p,q,r);

      }
 Question Submitted By :: Susie
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); }
Answer
# 1
Answer : 

      0001...0002...0004

      Explanation:

++ operator  when applied to pointers increments address
according to their corresponding data-types.
 
Is This Answer Correct ?    0 Yes 0 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }  1
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }  1
Write a program that find and print how many odd numbers in a binary tree  1
String copy logic in one line. NetApp9
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }  1
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }  1
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }  1
Finding a number which was log of base 2 NetApp1
Give a one-line C expression to test whether a number is a power of 2. Microsoft8
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }  1
main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }  1
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }  1
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }  1
What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }  1
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }  1
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!  7
main() { int i=400,j=300; printf("%d..%d"); }  1
main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above HCL1
main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }  1
Is the following code legal? struct a { int x; struct a b; }  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