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 program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  


Write a C program to add two numbers before the main function is called.

11 Answers   Infotech, TC,


x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);

2 Answers  


How to palindrom string in c language?

6 Answers   Google,


‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  






program to find magic aquare using array

4 Answers   HCL,


What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;

1 Answers  


#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }

2 Answers  


main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024

2 Answers   HCL,


main() { extern out; printf("%d", out); } int out=100;

1 Answers  


Design an implement of the inputs functions for event mode

0 Answers   Wipro,


What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


Categories