-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatic.cpp
More file actions
55 lines (53 loc) · 752 Bytes
/
static.cpp
File metadata and controls
55 lines (53 loc) · 752 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
#include<iostream>
using namespace std;
class student{
private:
char n[10],b[10];
int r;
public:
void name();
void roll();
void branch();
void display();
};
void student::name()
{
cout<<"enter name of the student"<<endl;
cin>>n;
}
void student::roll()
{
cout<<"enter roll no."<<endl;
cin>>r;
}
void student::branch()
{
cout<<"enter branch"<<endl;
cin>>b;
}
void student::display()
{
cout<<"name is"<<n<<endl;
cout<<"branch is"<<b<<endl;
cout<<"roll no. is"<<r<<endl;
}
int main()
{
int i,c;
student st[10];
c=1;
do
{
cout<<"for student no."<<c<<endl;
st[c].name();
st[c].roll();
st[c].branch();
st[c].display();
cout<<"do you want to continue"<<endl;
cin>>i;
if(i==1)
{
c++;
}
}while(i=1);
}