Check out example codes for "setw in c++". It will help you in understanding the concepts better.

Code Example 1

cout << setw(10) << "Hello" << endl;

Learn ReactJs, React Native from akashmittal.com