โ Back to Variables
Question 276
Split Cents into Dollars and Cents
Split Cents into Dollars and Cents
Declare int totalCents = 1234. Split it into whole dollars and leftover cents, then print the amount in the exact format below:
$12.34Expected Output:
$12.34
Topics:
Variables
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.