CJCoding With Joseph
15free / daySign inCreate account

Fuel Cost For A Trip

Read a trip distance in kilometres, a fuel economy in litres per 100 km and a fuel price per litre, all decimal numbers, then print two lines: Litres: <value> with one decimal, where the litres are the distance divided by 100 times the economy, and Cost: <value> with two decimals, the litres times the price. Input: three lines in that order, no prompts.

Expected Output:

Litres: 32.0
Cost: 48.00

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

Hints3 available
Topics:
User Input
📥 Auto-Input:
400\n8\n1.50\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.