Volume converter
From Programming In C
[edit]
Exercise 2.2
In the UK we very much live in a hybrid world of imperial and metric quantities. This is especially so for volumes of liquids. We ask for a pint of beer and yet fill up our cars with litres of petrol. Write a short C program that converts litres into pints and fluid ounces. You will need to think carefully about integer division and remainders for this exercise.
Note that 1 litre = 1.76 pints and that 1 pint contains 20 fluid ounces.
When your program runs it should look something like (in bold font is what you type at the keyboard):
Enter the number of litres: 4.82 4.82 litres = 8 pints and 9.66 fluid ounces.
