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

create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"

2 Answers  


#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }

2 Answers  


main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }

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  


main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O

4 Answers   HCL,






How can u say that a given point is in a triangle? 1. with the co-ordinates of the 3 vertices specified. 2. with only the co-ordinates of the top vertex given.

1 Answers  


Write a single line c expression to delete a,b,c from aabbcc

2 Answers   Microsoft,


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

0 Answers   Nagarro,


int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p

2 Answers  


what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }

3 Answers   Wipro,


hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?

6 Answers  


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

1 Answers  


Categories