Aligned text print
//setw
#include<iostream.h>
#include<iomanip>//setw
int main(int argc, char *argv[])
{
//right justified aligned cout<<setw(10)<<"Hello"<<setw(5)<<"all"<<endl;
cout<<setw(10)<<"hi"<<setw(5)<<"yo"<<endl;
return 0;
}
//setw
#include<iostream.h>
#include<iomanip>//setw
int main(int argc, char *argv[])
{
//right justified aligned cout<<setw(10)<<"Hello"<<setw(5)<<"all"<<endl;
cout<<setw(10)<<"hi"<<setw(5)<<"yo"<<endl;
return 0;
}
Comments
Post a Comment