CJCoding With Joseph

Right-Aligned Price Column

Three prices 5.5, 12.25, and 100.0 are 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> with right, setw(8), fixed, and setprecision(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.