-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path22.cpp
52 lines (52 loc) · 1.13 KB
/
22.cpp
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
//This program is performed by 22CS051_DARSH
#include <iostream>
using namespace std;
#define MAX 10
class student
{
public:
char name[30];
int rollNo;
int cls;
char dev[2];
//member function to get student's details
void getDetails(void);
//member function to print student's details
void putDetails(void);
};
void student::getDetails()
{
cout<< "Enter Name : ";
cin >> name;
cout<< "Roll No. : " ;
cin >> rollNo;
cout << "Enter Class : ";
cin >> cls ;
cout << "Devision : ";
cin >> dev;
}
void student::putDetails()
{
cout << "Name\t : " << name << endl;
cout << "Roll No. : " << rollNo << endl;
cout << "Class \t : " << cls << endl;
cout << "Devision : " << dev << endl;
}
int main()
{
int a,b;
student std[MAX];
cout << "This program is performed by 22CS051_DARSH" << endl;
cout << "Enter nubmer of students : ";
cin>> a;
for ( b = 0; b< a; b++)
{
std[b].getDetails();
}
cout << endl;
for ( b = 0; b< a; b++)
{
std[b].putDetails();
}
cout << endl;
}