C LAB 6
C LAB 6
Code:
Output:
Problem 2: Write a program in C to calculate and print the electricity bill of a given
customer using a function. The customer ID, name, and unit consumed by the user is read and
passed to the function from the keyboard to display the total amount to be paid to the
customer using call by value. Use the Unit slab for calculating the bill.
If bill exceeds Rs. 400 then a surcharge of 15% will be charged and the minimum bill should
be of Rs. 100/-
customer ID -123
Name - John
Unit – 453
Amount to be Paid: Rs. 931.84
customer ID -131
Name - Bob
Unit – 75
Amount to be Paid:100
Code:
Output: