fork download
  1. #include <stdio.h>
  2.  
  3. struct Employee
  4. {
  5. int age;
  6. char Name[50];
  7. char Department[20];
  8. float Salary;
  9. };
  10.  
  11. union Person
  12. {
  13. int ag;
  14. char Nam[50];
  15. char Departent[20];
  16. float Salar;
  17. };
  18.  
  19. int main()
  20. {
  21. struct Employee emp1;
  22. union Person Person1;
  23.  
  24. printf(" The Size of Employee Structure = %d\n", sizeof (emp1) );
  25. printf(" The Size of Person Union = %d\n", sizeof (Person1));
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5320KB
stdin
45
stdout
 The Size of Employee Structure = 80
 The Size of Person Union = 52