-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemployee_details.cpp
More file actions
65 lines (61 loc) · 1017 Bytes
/
employee_details.cpp
File metadata and controls
65 lines (61 loc) · 1017 Bytes
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
#include<iostream>
using namespace std;
struct student
{
char name[20];
char gender[10];
int roll_no;
float marks[5];
void input();
void output();
}s[10];
void student::input()
{
int i,j,n;
cout<<"\nEnter the name \n";
cin>>name;
cout<<"\nEnter the roll no\n";
cin>>roll_no;
cout<<"\nenter the gender\n";
cin>>gender;
cout<<"\nenter marks of 5 subjects\n";
for(j=0;j<5;j++)
{
cin>>marks[j];
}
}
void student::output()
{
int i,j,n;
cout<<"\nstudent name:\n";
cout<<name;
cout<<"\nstudent roll no:\n";
cout<<roll_no;
cout<<"\nstudent gender:\n";
cout<<gender;
cout<<"\nmarks:\n";
for(j=0;j<5;j++)
{
cout<<marks[j];
}
}
int main()
{
int i, n, j;
cout<<"\nEnter number of students data you want to enter:\n";
cin>>n;
cout<<"Enter information of students:\n";
for(i=0;i<n;i++)
{
cout<<"\nfor student number";
cout<<i+1<<endl;
s[i].input();
}
for(i=0;i<n;i++)
{
cout<<"\ndisplaying information for student";
cout<<i+1<<endl;
s[i].output();
}
return 0;
}