Answer to Question #175261 in C for Sai Shashank

Question #175261

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:03:44-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

Sai Shashank
25.03.21, 05:37

Sir, u have used C++ in this solution...I wanted the program in C language

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS