/* Program to accept an employee's record and copy it in another strut */ /* Problem 29 */ #include #include struct employee { char name[20]; int age; float salary; }; main() { struct employee emp1[5],emp2[5]; int i; clrscr(); printf("Enter the following details for five employees, "); printf("\n"); for (i = 0; i < 5; i++) { printf("\nName : "); scanf("%s",&emp1[i].name); printf("Age : "); scanf("%d",&emp1[i].age); printf("Salary : "); scanf("%f",&emp1[i].salary); emp2[i] = emp1[i]; } printf("\nThe record is has been copied to another strucuture, "); printf("\n\nName \tAge\tSalary"); printf("\n"); for (i = 0; i < 5; i++) { printf("%-20s",emp2[i].name); printf("\t%d",emp2[i].age); printf("\t%.2f\n",emp2[i].salary); } printf("\n\nPress any key to exit..."); getch(); }