-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathQ22.c
29 lines (29 loc) · 971 Bytes
/
Q22.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* Program:22
Write C program to accept the details of employee and display them using structure. Details
consist of Employee ID, Name, Designation, Department, Salary.
*/
#include <stdio.h>
struct employee
{
long long int id;
int salary;
char name[30];
char designation[20];
char department[20];
};
void main()
{
struct employee e;
printf("Enter Employee ID, Name, Designation, Department, Salary.\n");
scanf("%lld", &e.id);
fflush(stdin);
gets(e.name);
gets(e.designation);
gets(e.department);
scanf("%d", &e.salary);
printf("\nEmployee ID : %lld\n", e.id);
printf("Employee Name : %s\n", e.name);
printf("Employee Designation : %s\n", e.designation);
printf("Employee Department : %s\n", e.department);
printf("Employee Salary : %d\n", e.salary);
}