0% found this document useful (0 votes)
2 views

Employee Structure

The document contains a C program that collects employee details such as name, employee number, department, and working days to calculate and display their salary. The program uses a structure to store employee information and performs input/output operations to interact with the user. It demonstrates successful execution with sample outputs for two employees.

Uploaded by

srikaran.m123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Employee Structure

The document contains a C program that collects employee details such as name, employee number, department, and working days to calculate and display their salary. The program uses a structure to store employee information and performs input/output operations to interact with the user. It demonstrates successful execution with sample outputs for two employees.

Uploaded by

srikaran.m123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

main.

c Output
1
2 #include <stdio . h>
3 #include<string.h>
4 struct Emp
5 {
6 char name [30]:
7 int eno;
8 char dept [30]:
9 int dayi
10 int sal;
11
12 }e;
13 int main()
14- {
15 printf("Enter the name of employees
:");
16 scanf ("%s",e.name);
17 printf("\n Enter the Employee
number:");
18 scanf("%d" ,&e. eno);
19 printf("\n Enter the Department
name: ");
20 scanf("%s",e.dept);
21 printf("\n Enter no of working days
:");
22 scanf("%d",&e.day);
23 e.sal=e.day*1500; Run
24 printf("\n\t\tEmployee Salary
main.c Output

16 scanf(""%s",,e.name);
17 printf("\n Enter the Employee
number:");
18 scanf("%d",&e. eno);
19 printf("\n Enter the Department
name:");
20 scanf("%s",e.dept);
21 printf("\n Enter no of working days
:");
22 scanf (" %d" , &e.day);
23 e.sal=e.day*1500:
24 printf("\n\t\tEmployee Salary
details");
25 printf("\nEmployee name:\t%s",e
.name );
26 printf("\n Department:lt%s",e.dept
):
27 printf("\nSAlary: \t%d", e.sal);
28
29 return 0;
30
31
32 }
33
34
35
Run
36
37
main.c Output

/tmp/3J03NeiZfy.o
Enter the name of employees: rukshana
rukshana

Enter the Employee number:456

Enter the Department name:bca

Enter no of working days:45

Employee Salary details


Employee name: rukshana
Department: bca
SAlary: 67500

Code Execution Successful ==


main.c Output

/tmp/PLUfiohJeY .o
Enter the name of employees: janani

Enter the Employee number:5678

Enter the Department name:bca

Enter no of working days:30

Employee Salary details


Employee name: janani
Department: bca
SAlary: 45000

Code Execution Success ful ==

You might also like