-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclass1.cpp
More file actions
42 lines (34 loc) · 776 Bytes
/
class1.cpp
File metadata and controls
42 lines (34 loc) · 776 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
#include<iostream>
#include<string>
using namespace std;
class student
{
string student_name;
int roll_no;
int SAP_ID;
string Specialisation;
public:
void Read_data()
{
cout<<"Enter Student's Name"<<endl;
cin>>student_name;
cout<<"Enter Roll number of student"<<endl;
cin>>roll_no;
cout<<"Enter SAP_ID of the student"<<endl;
cin>>SAP_ID;
cout<<"Enter the Specialisation of the student"<<endl;
cin>>Specialisation;
}
void show()
{
cout<<"Name of the student is "<<student_name<<endl<<"ROll number of the student is "<<roll_no<<endl<<"SAP ID of the student is "<<SAP_ID<<endl<<"Specialisation of the student is "<<Specialisation<<endl;
}
};
int main()
{
cout<<"Hello User!\nThis is the first programme of Classes"<<endl;
student S;
S.Read_data();
S.show();
return 0;
}