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

Popular posts from this blog

serial to parallel test with 74c595 and pic mcu

ဆိုလာ စနစ္ရွိ BATTERY AMPACITY အား design ထုတ္တြက္ခ်က္ၿခင္း (1) watt hour ရယူၿခင္း

INTERRUPT_ON_CHANGE_18f4550