CJCoding With Joseph
15free / daySign inCreate account

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 (see Expected Output).

Use <iomanip> with right, setw(8), fixed, and setprecision(2).

Expected Output:

    5.50
   12.25
  100.00

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
Printing
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.