Saturday 4 January 2014

Use of manipulaltors

//manipulators are used to format data display
//Associtivity is from right to left

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main()
{
clrscr();
cout<<setw(10)<<"First Name"<<setw(10)<<"Last Name"<<endl;
cout<<setw(10)<<"John"<<setw(10)<<"Pal"<<endl;
cout<<setw(10)<<"Aditya"<<setw(10)<<"Roy"<<endl;
cout<<setw(10)<<"Nathan"<<setw(10)<<"Bracken"<<endl;
getch();
}

No comments:

Post a Comment