To store employees details we used structure array. Each element in the structure array represents the single employee.

Each Structure i.e Employee contains:

  • Name
  • Id
  • Salary

After taking input, we simply printed all employee details by iterating using for loop.

C Program to Read and Print Employee Details

Output of Program

C Program for Employee Details using Structure

If you didn’t understand any part of the code then do comment below.

This Post Has 4 Comments

  1. Balaji

    What is the difference between array and structure array

    1. Adarsh Kumar

      They both are similar. The difference is the type of data in the array. When we declare int array[10], we mean to store integers into the array and in case of Employee array[10], we mean to store structure objects into the array.

  2. Balaji

    Why you have write the Employee; after defining structure

    1. Adarsh Kumar

      Any name you put at the end of the structure declaration along with typedef at the beginning is used to rename the structure. In our case, we have renamed the structure as Employee. so that we can address the structure in main funtion using just Employee instead of struct Employee.

Leave a Reply