Setwidth, setw,formatted output
//formatted output
//setf
//setw
#include<iostream.h>
#include<iomanip>
double i[3]={1234.9766,0.854335,8652146.9};
char *k[3]={"still","alive","guys"};
int main(int argc, char *argv[])
{
cout.setf(ios::fixed);
cout<<endl;
for(int c=0;c<3;c++)
{
cout<<setw(10)<<k[c];
cout<<setw(20)<<i[c]<<endl;
}
return 0;
}
Comments
Post a Comment