#include <stdio.h>
int main() {
int u;
printf("Enter units consumed:");
scanf("%d",&u);
if(u<=100)
printf("Net Bill=%d",u);
else if(u<=200)
printf("Net Bill=%d",100+(u-100)*1);
else if(u<=300)
printf("Net Bill=%d",250+(u-200)*2);
else if(u<=400)
printf("Net Bill=%d",500+(u-300)*3);
else
printf("Net Bill=%d",750+(u-400)*5);
}
No comments:
Post a Comment