โ Back to Printing
Question 317
Right-Aligned Price Column
Right-Aligned Price Column
Three prices5.5,12.25, and100.0are given. Print each on its own line, right-aligned in an 8-character field with exactly 2 decimals, so the decimal points line up: 5.50 12.25 100.00 Use<iomanip>withright,setw(8),fixed, andsetprecision(2).
Expected Output:
5.50 12.25 100.00
Topics:
Printing
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.