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;

}

Comments

Popular posts from this blog

Inductance caculator

Pointer to object array