AIM:-Write To Program Find Electricity Bill Using Programming c

 

Input:-

#include<stdio.h>

int main()

{

    float unit,bill;

    

    printf(“************ Electricity Bill ***********”);

    printf (“Enter Your Units :  );

    scanf(“%f”,&unit);

    if(unit > 400)

        bill = ( (100*3) + (100*3.5) + (200*4.25) + ((unit – 400)*5));

    else if(unit > 200)

        bill = ( (100*3) + (100*3.5) + ((unit – 200)*4.25));

    else if(unit > 100)

        bill = ( (100*3) + ((unit – 100)*3.5) );

    else

        bill = unit*3;

    

    printf(“Your Electricity Bill : %f”,bill);

    return 0;

}

Output:-

************ Electricity Bill ***********Enter Your Units :  150

Your Electricity Bill : 475.000000

Advertisements