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);

}



struct aaa{ struct aaa *prev; int i; struct aaa *next; }; ..

Answer / susie

Answer :

2

Explanation:

above all statements form a double circular linked list;

abc.next->next->prev->next->i

this one points to "ghi" node the value of at
particular node is 2.

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More C Code Interview Questions

write a c program to print magic square of order n when n>3 and n is odd?

1 Answers   HCL,


What is "far" and "near" pointers in "c"...?

3 Answers  


programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h

1 Answers  


Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.

2 Answers  


const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above

1 Answers   emc2, HCL,






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); }

2 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  


How we will connect multiple client ? (without using fork,thread)

3 Answers   TelDNA,


main() { int a[10]; printf("%d",*a+1-*a+3); }

1 Answers  


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 Answers  


pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"

2 Answers  


Categories