Home / MCQ Bank / Computer
Computer Structure And Union

What will be the output of the following C code? #include <stdio.h> struct student { char *name; }; struct student s; struct student fun(void) { s.name = "newton"; printf("%s\n", s.name); s.name = "alan"; return s; } void main() { struct student m = fun(); printf("%s\n", m.name); m.name = "turing"; printf("%s\n", s.name); }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • newton alan alan

Related Computer Questions

How do you catch an exception by reference in C++? Find the length of the longest increasing subsequence for the given sequence: {-10, 24, -9, 35, -21, 55, -41, 76, 84} In which context does the stack operates? What is the purpose of the event onAirEvent? Which of the following escape sequence represents carriage return?