Structure And Union - Study Mode

[#131] Which function is responsible for recording the name "s" and the replacement text "t" in a table?
Correct Answer

(A) install(s, t)

[#132] The number of distinct nodes the following struct declaration can point to is . . . . . . . . struct node
{
struct node *left
struct node *centre
struct node *right
}
Correct Answer

(D) All of the mentioned

[#133] What will be the output of the following C code? #include <stdio.h>
struct student
{
char *c
}
void main()
{
struct student s[2]
printf("%d", sizeof(s))
}
Correct Answer

(D) 8

[#134] What will be the output of the following C code? #include <stdio.h>
struct p
{
int x[2]
}
struct q
{
int *x
}
int main()
{
struct p p1 = {1, 2}
struct q *ptr1
ptr1->x = (struct q*)&p1.x
printf("%d
", ptr1->x[1])
}
Correct Answer

(B) Segmentation fault/code crash

[#135] What will be the output of the following C code? #include <stdio.h>
union p
{
int x
char y
}k = {.y = 97}
int main()
{
printf("%d
", k.y)
}
Correct Answer

(B) 97