Top

Discussion

What is the output of this program?

#include 
int main(){
    struct leader
 {
 char *lead;
 int born;
 };
 struct leader l1 = {"AbdulKalam", 1931};
 struct leader l2 = l1;
 printf("%s %d", l2.lead, l1.born);
}

 

  • A.Compilation error
  • B.Garbage value 1931
  • C.AbdulKalam 1931
  • D.None of the above

Answer: C

We can assign one structure member to the another structure member as like normal variable assignmentation. We can access the same values using different structure variables.

No comment is present. Be the first to comment.
Loading…

Post your comment