How to calculate electric bill?

CODE




How to calculate electric bill?
Program for Electric bill. Follow the instruction:
If units<=200 -> 2
If units<=400 -> 3
If units<=600 -> 4
Else 5
int main()
{
    float unit,bill,tax,gross;
    printf("\n enter number of units:");
    scanf("%f",&unit);
    if(unit<=200)
        bill=unit*2;
    else if(unit>200 && unit<=400)
        bill=unit*3;
    else if(unit>400 && unit<=600)
        bill=unit*4;
    else
        bill=unit*5;
    tax=bill*10/100;
    gross=bill+tax;
    printf("\n gross bill=%f",gross);
}



Output:
enter number of units:
500

 gross bill=2200.000000

How to calculate electric bill? How to calculate electric bill? Reviewed by Unknown on December 15, 2018 Rating: 5

No comments:

If you have any doubt or query ,comment below:

Programming copyright © 2018-19. Powered by Blogger.