Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class student{
- int roll;
- public:
- void getdata() {
- cout<<"enter your roll no ";
- cin>>roll;
- }
- void display() {
- cout<<"roll no "<<roll;
- }
- };
- using namespace std;
- int main()
- {
- student s;
- s.getdata();
- s.display();
- return 0;
- }
- /*
- Output
- enter your roll no 5
- roll no 5
- */
Advertisement
Add Comment
Please, Sign In to add comment