4. //Program for nested structure
#include<stdio.h>
#include<conio.h>
void main()
{
struct address
{
char land[30];
int strtno;
int hno;
char city[20];
};
struct date
{
int d;
int m;
int y;
};
5. struct person
{
int id;
char n[20];
int age;
struct date D;
struct address A;
};
struct person p;
int x;
clrscr();
printf("enter the details of the person:n");
printf("Id,name, agen");
scanf("%d%s%d",&p.id,&p.n,&p.age);
x=strupr(p.n);
//printf("%s",x);
printf("enter DOBn");
scanf("%d%d%d",&p.D.d,&p.D.m,&p.D.y);
printf("enter address land,strtno,hno,cityn");
scanf("%s%d%d%s",&p.A.land,&p.A.strtno,&p.A.hno,&p.A.city);
7. Enter the details of the person:
Id,name,age
12
sara
24
enter DOB
05
04
1987
enter address land,strtno,hno,city
Mahakali_colliery
20
N/17
Chandrapur
******************OUTPUT********************
ID=12
NAME=SARA
AGE=24
DOB=05/04/1987
ADDRESS=Mahakali_colliery 20 N/17 Chandrapur