Friday, 17 July 2020

Structure for Employee

A programmer wants to use two variables session and info. Variable session can take three values (morning, afternoon, evening) ly. Using variable info, the programmer wants to access information empname and empid of 30 employees. Name the appropriate data type used for each variable session and info and declare the variables.

Answer : 



#include<stdio.h>
#include<conio.h>
/*============================
     Girfa Student Help
     structure data type
==============================*/

enum daytime
{
     morning,
     afternoon,
     evening
};
struct emp
{
     int empid;
     char empname[50];
     enum daytime session;
};
void main()
{
     struct emp ar[30];
}


No comments:

Post a Comment