Examveda

What will be the output of the following C code?
#include <stdio.h>
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

B. alan alan turing turing

C. alan turing alan turing

D. run time error

Answer: Option A


This Question Belongs to C Program >> Structure And Union

Join The Discussion

Related Questions on Structure and Union