-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoffice_data.c
124 lines (84 loc) · 3.29 KB
/
office_data.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/* office_data mon 05 07 2023 05:03:15 murali*/
/*
module: office_data
function:
this is going to collect the data's of employee's in office and stored it in a file for future purpose
version: 1.0.0a mon 05 07 2023 05:04:10 murali
Copyright notice:
This file copyright (C) 2023 by
MCCI Corporation
3520 Krums Corners Road
Ithaca, NY 14850
An unpublished work. All rights reserved.
This file is proprietary information, and may not be disclosed or
copied without the prior permission of MCCI Corporation.
Author:
murali sunadarmoorthi, MCCI 07 2023
*/
#include <stdio.h>
/******************************************************************************\
This module is an example module.
(Text explanation of contents of file, as long as required.)
At one time, specially-formatted ‘help’ program text was embedded here
also, to aid in maintaining a separate ‘help’ facility.
\******************************************************************************/
/****************************************************************************\
Manifest constants & typedefs.
This is strictly for private types and constants which will not
be exported.
\****************************************************************************/
typedef struct office
{
char name[100];
int id ;
int in_time; // in hours only
int out_time; // in hours only
}data;
/****************************************************************************\
Read-only data.
If program is to be ROM-able, these must all be tagged read-only
using the ROM storage class; they may be global.
\****************************************************************************/
/****************************************************************************\
VARIABLES:
If program is to be ROM-able, these must be initialized
using the BSS keyword. (This allows for compilers that require
every variable to have an initializer.) Note that only those
variables owned by this module should be declared here, using the BSS
keyword; this allows for linkers that dislike multiple declarations
of objects.
\****************************************************************************/
/*
name: main()
function: collectinfg the data from user and display the data
definition: void main();
description:
creating array of object for the structure variable and through that fetch the empolyee data from user using iteration method
stored the data for the purpose of future like refer the data in month end for salary calculation etc..
returns: nothing going to return cause of main is void type
*/
void main()
{
data e1[3];
char i;
for(i=1;i<=3;i++)
{
printf("enter the name of employee %d: ",i);
scanf(" %s", e1[i].name);
printf("enter the id : ");
scanf("%d", &e1[i].id);
printf("enter the in time : ");
scanf("%d", &e1[i].in_time);
printf("enter the out time : ");
scanf("%d", &e1[i].out_time);
}
printf("---------------------------------------\n");
for(i=1;i<=3;i++)
{
printf(" name of employee :%s\n", e1[i].name);
printf("employee id : %d\n", e1[i].id);
printf(" in_time : %d\n", e1[i].in_time);
printf("out_time :%d\n", e1[i].out_time);
printf("---------------------------------------\n");
}
}