Structures
- What will be the output of the following C code?
#include <stdio.h>
typedef struct N *ptr2;
struct N
{
int n1;
char n2;
ptr2 ptr1;
};
int main()
{
struct N n = {111, 222, &n};
printf("%d\n", n.ptr1->ptr1->n1);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
111
- The number of distinct nodes the following struct declaration can point to is _____________.
struct node
{
struct node *left;
struct node *centre;
struct node *right;
};
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Option A, B and C is right answer.
- Which of the following is not possible regarding structure variable?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
None of these
- Which of the following technique is faster for travelling in binary trees?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Recursion
- Which of the following will stop the loop at the last node of a linked list in the following C code snippet?
struct node
{
struct node *next;
};
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
None of these