-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice_1.cpp
More file actions
43 lines (36 loc) · 803 Bytes
/
practice_1.cpp
File metadata and controls
43 lines (36 loc) · 803 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
#include<iostream>
using namespace std;
class student
{
public:
char collegeid[10];
char name[30];
int semester;
int display();
};
int student::display()
{
student s1;
int i;
for(i=0;i<3;i++)
{
cout << "College id of student " << i+1 << " is " << endl;
cin >> s1.collegeid;
cout << "Name of student " << i+1 << " is " << endl;
cin >> s1.name;
cout << "Semester of student " << i+1 << " is " << endl;
cin >> s1.semester;
}
for(i=0;i<3;i++)
{
cout << "College id of student " << i+1 << " is " << s1.collegeid << endl;
cout << "Name of student " << i+1 << " is " << s1.name << endl;
cout << "Semester of student " << i+1 << " is " << s1.semester << endl;
}
}
int main()
{
student s[3];
s.display();
return 0;
}