Print a correct, neatly aligned bill with discount and GST for a small shop that still writes bills by hand.
Skills: C / any language, loops, conditions, formatted output
Inspired by everyday billing at a local kirana shop
Raju runs a small kirana shop. He writes every bill by hand and often makes mistakes in the totals, especially when the shop is crowded.
Write a program that takes the items a customer bought and prints a correct bill. Above ₹1000 the shop gives a 5% discount, and 5% GST is added on the amount after discount.
Sample input (number of items, then name quantity rate):
3
Rice 5 62
Oil 2 145
Sugar 3 44Expected output (shape):
Item Qty Rate Amount
Rice 5.00 62.00 310.00
Oil 2.00 145.00 290.00
Sugar 3.00 44.00 132.00
Subtotal: 732.00
Discount: 0.00
GST (5%): 36.60
Total: 768.60Create a free student account to submit your work, get mentor feedback and unlock the reference solution.