/* Name: Demo setw and endl Copyright: www.micted.weebly.com Author: Nawaraj Ghimire ([email protected]) Date: 19/10/13 15:41 Description: To demonstrate different I/O mainpulators (setw, endl) */ #include<conio.h> #include<iostream.h> #include<iomanip.h> #include<stdio.h> class bridge_course { private: int roll; char name[20]; public: void getdata() { cout<<"Enter tha student roll no:"<<endl; cin>>roll; cout<<"enter student name"<<endl; cin>>name; } void display() { cout<<setw(3)<<"Roll No.:"<<setw(2)<<roll<<setw(2); cout<<setw(2)<<"Name:"<<name<<endl; } }; void main() { clrscr(); bridge_course s1,s2,s3; s1.getdata(); s2.getdata(); s3.getdata(); s1.display(); s2.display(); s3.display(); getch(); }