/* Name: Create class Copyright: www.micted.weebly.com Author: Nawaraj Ghimire([email protected]) Date: 19/10/13 16:11 Description: To create class "student" */ #include<conio.h> #include<iostream.h> #include<iomanip.h> #include<stdio.h> class student { private: int roll; char name[20]; long int mobile; public: void getdata() { cout<<"Enter tha student roll no:"<<endl; cin>>roll; cout<<"enter student name"<<endl; cin>>name; cout<<"enter mobile number"<<endl; cin>>mobile; } void display() { cout<<setw(3)<<"Roll No.:"<<setw(2)<<roll<<setw(2); cout<<setw(2)<<"Name:"<<name<<endl; cout<<setw(5)<<"Mobile:"<<mobile<<endl; } }; void main() { clrscr(); student s1,s2,s3; s1.getdata(); s2.getdata(); s3.getdata(); s1.display(); s2.display(); s3.display(); getch(); }