Vidyalelo
C Programming · Q77

Structure and Union

Programming · C Programming · question 77

Q77

What will be the output of the following C code? #include struct student char *name; ; struct student s[2]; void main() s[0].name = "alan"; s[1] = s[0]; printf("%s%s", s[0].name, s[1].name); s[1].name = "turing"; printf("%s%s", s[0].name, s[1].name);

A.
alan alan alan turing
Answer
B.
alan alan turing turing
C.
alan turing alan turing
D.
run time error

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board