Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- struct date {
- int year;
- int month;
- int day;
- };
- struct time {
- int hour;
- int minute;
- int second;
- };
- struct vaccine_person {
- int person_id;
- char name[50];
- int age;
- struct date vaccination_date;
- struct time vaccination_time;
- };
- int main() {
- struct vaccine_person person1 = {
- 123456,
- "John Smith",
- 30,
- {2021, 4, 10},
- {14, 30, 0}
- };
- printf("Person ID: %d\n", person1.person_id);
- printf("Name: %s\n", person1.name);
- printf("Age: %d\n", person1.age);
- printf("Vaccination Date: %d-%02d-%02d\n",
- person1.vaccination_date.year,
- person1.vaccination_date.month,
- person1.vaccination_date.day);
- printf("Vaccination Time: %02d:%02d:%02d\n",
- person1.vaccination_time.hour,
- person1.vaccination_time.minute,
- person1.vaccination_time.second);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement