C++ Structural programming exercise
Write a program to accept and display the data of employees and the salary of the employee.
Make a structure which consists of fields name, age, position and salary.
Using this structure declare a variable and use this variable to access the members of the structure and input the employee information. Finally display this information.
Solution:
We define a structure and then we use this structure as a data type to declare variables of this structure. Each of these variables has all the members or fields of the structure to access these members we use variableName.member;