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

main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }

1 Answers  


could you please send the program code for multiplying sparse matrix in c????

0 Answers  


int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too

1 Answers  


main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 Answers  


How to read a directory in a C program?

4 Answers  






How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com

11 Answers   Deshaw, Infosys,


main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }

1 Answers  


print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!

35 Answers   Tata Elxsi, TCS, VI eTrans,


#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 Answers  


how to check whether a linked list is circular.

11 Answers   Microsoft,


void ( * abc( int, void ( *def) () ) ) ();

1 Answers  


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

3 Answers   TelDNA,


Categories