Answer to Question #173904 in C for R SWASTHIK

Question #173904

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.


1
Expert's answer
2021-03-25T03:09:40-0400
#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;
}




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS