Short answer type Questions on Structure & Union
1. What is a structure?
A structure is a group of data of different data types.
2. What is meant by structure template?
A structure template contains definition of a structure name and a list of members along with datatypes.
3. What is meant by structure declaration?
Declaration of a structure means memory storage is allotted to every structure variable.
4. Which operator is used to access the structure elements?
dot (.) operator
5. Write the syntax for structure definition.
syntax:
struct structure_name
{
Datatype member1;
Datatype member2;
……….
};
6. Write the syntax for structure declaration.
syntax: struct structure_name v1,v2,v3…..;
7. Which is the reserved word which is used in structure definition ?
struct
8. What are unions?
A union is a group of data of different data types all of which share a common storage location.
9. Write the syntax for union definition declaration.
syntax: union union_name
{
Datatype member1;
Datatype member2;
………;
};
10. Write the syntax for union declaration.
syntax: union union_name v1,v2,v3,……;
Thanks
Mukesh Rajput
Post A Comment:
0 comments: