Home » C Programming » Structures » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    struct Employee
    {
    char *name;
    };
    struct Employee emp[2];
    void main()
    {
    emp[0].name = "Ajit";
    emp[1] = emp[0];
    printf("%s %s", emp[0].name, emp[1].name);
    emp[1].name = "Sujit";
    printf(" %s %s", emp[0].name, emp[1].name);
    }
    1. Ajit Ajit Ajit Sujit
    2. Sujit Ajit Ajit Ajit
    3. Sujit Ajit
    4. Compilation Error
    5. None of these
Correct Option: A

Ajit Ajit Ajit Sujit



Your comments will be displayed only after manual approval.