Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class student
- {
- int indexnumber,marks;
- char name[30];
- char course[5];
- public :
- void getdata();
- void display();
- };
- void student::getdata()
- {
- cout<<"enter the index number";
- cin>>indexnumber;
- cout<<"enter the course";
- cin>>course;
- cout<<"enter the marks";
- cin>>marks;
- }
- void student::display()
- {
- cout<<"*******Student name********"<<endl;
- cout<<"NAME:"<<name<<endl;
- cout<<"INDEX NUMBER:"<<indexnumber<<endl;
- cout<<"COURSE:"<<course<<endl;
- cout<<"MARKS:"<<course<<endl;
- }
- int main()
- {
- student S1;
- S1.getdata();
- S1.display();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement