0% found this document useful (0 votes)
11 views2 pages

Electricity Bill

Uploaded by

hiremathsiddhant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Electricity Bill

Uploaded by

hiremathsiddhant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

//Electricity bill//

#include<stdio.h>
int main()
{
char username[50];
int unitsConsumed;
float totalAmount,surcharge=0;
printf("enter name:");
scanf("%s",&username);
printf("enter units consumed:");
scanf("%d",&unitsConsumed);

if(unitsConsumed<=200)
{
totalAmount=unitsConsumed*3.50+100;
}
else if(unitsConsumed<=300)
{
totalAmount=200*3.50+(unitsConsumed-200)*6+100;
}
else
{
totalAmount=200*3.5+100*6.0+(unitsConsumed-300)*10.5+100;
}
If(totalAmount>400)
{
surcharge=0.15*totalAmount;
totalAmount=totalAmount+surcharge;
}
printf("\n Owner name is: %s",username);
printf("\n Consumed unit: %d",unitsConsumed);
printf("\n Consumed unit %d bill is %f",unitsConsumed,totalAmount);
return 0;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy