P197. Program to understand nested structure.
#include<stdio.h>
struct
st
{
int roll;
char name[10];
struct date
{
int day;
int month;
int year;
}doj,dob;
};
void
main()
{
struct st v;
v.doj.day=20;
v.doj.month=7;
v.doj.year=1997;
v.dob.day=20;
v.dob.month=12;
v.dob.year=1994;
printf("DOJ =
%d:%d:%d\n",v.doj.day,v.doj.month,v.doj.year);
printf("DOB =
%d:%d:%d\n",v.dob.day,v.dob.month,v.dob.year);
}
Comments
Post a Comment