Untitled
unknown
plain_text
2 years ago
466 B
9
Indexable
#include<iostream>
#include<string>
#include<conio.h>
using namespace std;
class student
{ int rollno;
string name;
public:
void get_data();
void put_data();
};
void student:: get_data()
{ cout<<"Enter roll number:";
cin>>rollno;
cout<<"Enter name:";
cin>>name;
}
void student:: put_data()
{
cout<<"Roll number is :"<<" "<<rollno<<"\n Name is :"<<name;
}
int main()
{
student s;
s.get_data();
s.put_data();
return 0;Editor is loading...