Difference between right and left justifications when using setw manipulator | Sololearn: Learn to code for FREE!

0

Difference between right and left justifications when using setw manipulator

c++

1/25/2017 3:53:46 PM

Akiti Bala

1 Answer

New Answer

+3

Right is the default of Numbers, while Left is the default for Text Strings... Right one first leaves the spaces, and then prints the characters, while it is the opposite in Left one... Eg- cout<<setw(10)<<100<<endl; //Prints _______100 where _=space... cout<<setw(10)<<"Hey"<<endl; //Prints Hey_______ where _=space...