Calculate Net Electric Charges of Consumers coderinme

Calculating Net Electric Power Charges

Assignment: An electric power company charges its domestics consumers as follows:
Consumption unit Rate of charge
0-200 Rs. 0.50 per unit
201-400 Rs. 100 + Rs. 0.65 per unit excess of 200
401-600 Rs. 230 + Rs. 0.80 per unit excess of 400
601 and above Rs. 390 + Rs. 1.00 per unit excess of 600
C program to read the customer number and power consumed and print the amount to be paid by the customer

int main()
{
int unit,num;
float cost;
printf("Enter the consumer No.: ");
scanf("%d",&num);
printf("Enter the Power consumption(in unit): ");
scanf("%d",&unit);
if( unit > 0 && unit  200 && unit  400 && unit  600)
cost = 390 + 1.0 * ( unit - 600 );
printf("Amount to be paid by the customer (Rs. %d): %.2f",num,cost);
getch();
return 0;
}

For more programs in C, visit our C Coder Archives

Calculate Net Electric Charges of Consumers coderinme

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator,” to the admin @coderinme

Leave a reply:

Your email address will not be published.