adplus-dvertising
frame-decoration

Question

What is the output of this program?
#include <stdio.h>
struct employee
{
  char *empname;
  int salary;
};
int main()
{
  struct employee e, e1;
  e.empname = "Sridhar";
  e1 = e;
  printf("%s %s", e.empname, e1.empname);
  return 0;
}

a.

Garbage value Sridhar

b.

Sridhar Garbage value

c.

Sridhar Sridhar

d.

Compilation Error

Answer: (c).Sridhar Sridhar

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?