Combine functions, structures and arrays in a small repair estimate.
Understand the concept
Each line item stores a name, quantity and unit price in paise. Integer paise avoids binary floating-point rounding for this small example. A function totals the array, and the program prints rupees and paise separately. Real billing also needs checked arithmetic and explicit tax and rounding rules.
Read the example
The complete program appears below. Read it first, predict the output, then run it.
Expected output
Estimate: INR 751.00
Practise
Print each line item before the total. Add a third item and verify the total by hand.
Common mistake
Validate quantities and prices before calculating. Large integer products can overflow; this educational example uses bounded constants.