Download to read offline

![#include<stdio.h>
#include<string.h>
struct address
{
char phone [15];
char city [15];
int pin;
} a1;
struct emp
{
char name [15];
int emp_no;
float salary;
}e1;](https://image.slidesharecdn.com/nestedstructure-171016142704/75/Nested-structure-Computer-programming-and-utilization-2-2048.jpg)


Nested structures in C allow one structure to be defined within another. This document demonstrates a nested structure with an address structure defined within an emp structure. It declares variables of each structure type, assigns values to their members, and prints the member values. The address structure contains phone, city, and pin members, while the emp structure contains name, emp_no, and salary members.
Nested structures in C allow structures to be defined within other structures, similar to how members are defined. This enables complex data representation.
Code demonstrates the definition of structures 'address' and 'emp', which include various data types. Example instances 'a1' and 'e1' are declared.
The code showcases how to initialize structure variables a1 and e1. Note: syntax errors in assignment should be corrected for proper compilation.
The final code prints the data from the nested structures using printf statements, allowing retrieval and display of the initialized values.

![#include<stdio.h>
#include<string.h>
struct address
{
char phone [15];
char city [15];
int pin;
} a1;
struct emp
{
char name [15];
int emp_no;
float salary;
}e1;](https://image.slidesharecdn.com/nestedstructure-171016142704/75/Nested-structure-Computer-programming-and-utilization-2-2048.jpg)

