Electrical and Computer Engineering
7 of 52
UAH
CPE 112
setw Examples
•Statement   (ans = 33, num = 7132)   Output ( means blank) cout << setw(4) << ans << setw(5)      337132Hi
•        << num << setw(4) << “Hi”;
• cout << setw(2) << ans << setw(4)     337132
•      << num