#include <stdio.h>
typedef struct
{
int data;
} info;
typedef struct
{
info age;
float salary;
} worker;
void print_struct(worker w);
int main(void)
{
worker w;
printf("Enter Age: ");
scanf("%d", &w.age.data);
printf("Enter Salary: ");
scanf("%f", &w.salary);
print_struct(w);
return 0;
}
void print_struct(worker w)
{
printf("age = %d\n", w.age.data);
printf("salary = %.2f\n", w.salary);
}
/*
run:
Enter Age: 43
Enter Salary: 5473
age = 43
salary = 5473.00
*/