Mr. Nuthan M S is given the task to maintain the details of the class teacher of his section, the details includes, Name of the faculty(String), employee ID(integer), Experience(int), Course handled(String). Help Mr. Nuthan to maintain the record by generating a C application
#include<stdio.h>
#include<string.h>
struct Employee_Details
{
int employee_id,experience;
char faculty_name[50],course_handled[50];
};
int main()
{
int n,i;
printf("Enter number of employees ");
scanf("%d",&n);
struct Employee_Details E[n];
for(i=0;i<n;i++)
{
printf("\nEnter Employee ID ");
scanf("%d",&E[i].employee_id);
printf("\nEnter Faculty Name ");
scanf("%s",E[i].faculty_name);
printf("\nEnter Course Handled ");
scanf("%s",E[i].course_handled);
printf("\nEnter years of experience ");
scanf("%d",&E[i].experience);
}
for(i=0;i<n;i++)
{
printf("\nEmployeee ID %d",E[i].employee_id);
printf("\nFaculty Name ");
puts(E[i].faculty_name);
printf("\nCourse Handled ");
puts(E[i].course_handled);
printf("\nYears of experience %d",E[i].experience);
}
return 0;
}
Comments
Sir, u have used C++ in this solution...I wanted the program in C language
Leave a comment