Which of the Following will define a type NODE that is a
node in a Linked list?
A)struct node {NODE*next;int x;};type def struct node NODE;
B)typedef struct NODE {struct NODE *next;int x;};
C)typedef struct NODE {NODE *next;int x;};
D)typedef struct {NODE *next;int x;}NODE;
Answers were Sorted based on User's Feedback
Answer / shahzad
B)
coz ..linked list node contain two parts ..
one is address to next node
other is data part in single list....
writting keyword struct before NODE is must..
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / gorgeousgirl
all the four given options throws error...
the correct answer should be:
typedef struct node NODE;
struct node {NODE*next;int x;};
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / ashwin kumar
Shahzad is correct
next node must be like a 1st node means it must have two
fields one for two store data and another field for
storing address of the next node.
in 2nd field where we have point to the next node we must
store address of the next node , so we are using pointer ,
as we are pointing to a next node of type structure so we
must use
struct NODE *next
plz info me if any mistake in my answer
molugu.ashwin@gmail.com
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / vikraman85
B is the answer..
b'coz in struct node *next only specify the address of the
next node.. others not..
Is This Answer Correct ? | 3 Yes | 2 No |
int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output?
what would be the output of the following prog? Justify your answer? main() { unsigned char ch; unsigned char i; ch = -255; printf("%d",ch); i = -1; printf("%d",i); }
Mention four important string handling functions in c languages .
Write a program which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.
Does c have enums?
How can I convert a number to a string?
Why enum is used in c?
compute the nth mumber in the fibonacci sequence?
10 Answers Canon, HPL, Satyam, TCS,
What is a stream in c programming?
7. Identify the correct argument for the function call fflush() in ANSI C: A)stdout B)stdin C)stderr D)All the above
How to compare array with pointer in c?
Write a code to reverse string seperated by spaces i/p str=India is my country o/p str=aidnI si ym yrtnuoc After writing code, optimize the code