#include <stdio.h>
struct student
{
char name[50];
int id;
union
{
float gpa;
int grade;
};
};
int main()
{
struct student s;
strcpy(s.name, "John");
s.id = 123;
s.gpa = 3.5;
printf("Name: %s\n", s.name);
printf("ID: %d\n", s.id);
printf("GPA: %f\n", s.gpa);
s.grade = 90;
printf("Grade: %d\n", s.grade);
return 0;
}