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   SiteMap shows list of All Categories in this site.
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
struct point

       {

       int x;

       int y;

       };

      struct point origin,*pp;

      main()

      {

      pp=&origin;

      printf("origin is(%d%d)\n",(*pp).x,(*pp).y);

      printf("origin is (%d%d)\n",pp->x,pp->y);

      }
 Question Submitted By :: Susie
I also faced this Question!!     Rank Answer Posted By  
 
  Re: struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }
Answer
# 1
Answer : 

      origin is(0,0)

      origin is(0,0) 

      Explanation:

pp is a pointer to structure. we can access the elements of
the structure either with arrow mark or with indirection
operator. 

      Note: 

      Since structure point  is globally declared x & y are
initialized as zeroes
 
Is This Answer Correct ?    0 Yes 0 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
Finding a number multiplication of 8 with out using arithmetic operator NetApp8
String copy logic in one line. NetApp9
main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }  1
main() { int i=10; i=!i>14; Printf ("i=%d",i); }  1
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }  1
how to delete an element in an array  1
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?  1
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD Synergy6
void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }  1
main() { int a[10]; printf("%d",*a+1-*a+3); }  1
main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?  1
How will u find whether a linked list has a loop or not? Microsoft6
#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }  1
main() { char *p; p="Hello"; printf("%c\n",*&*p); }  1
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }  1
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); } TCS2
void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }  1
Is the following code legal? struct a { int x; struct a b; }  1
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() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",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