
Structure and Union
1. What is a structure in C?
Ans: A structure is a collection of same or different data types, grouped together under a single
structure name. It is a derived data type arranged in a group of related data items of different data types.
2. How is a structure declared?
Ans: Structure is declared as follows:
struct struct_name
{
data type 1 variable1;
data type 2 variable2;
------------------
------------------
};
Explanati on: Structure declaration always starts with struct keyword. Here, struct_name
is known as tag. The struct declaration is enclosed with a pair of curly braces. Closing brace is
terminated with