#include<stdio.h>
#include<conio.h>
void main()
{
int units;
float total_bill;
clrscr();
printf("Enter the no. of units");
scanf("%d",&units);
if(units <= 100)
total_bill = units * 4;
else if(units <= 300)
total_bill = units * 4.5;
else if(units <= 500)
total_bill = units * 4.75;
else
total_bill = units * 5;
printf("the bill to be paid is = %f", total_bill);
getch();
}
#include<conio.h>
void main()
{
int units;
float total_bill;
clrscr();
printf("Enter the no. of units");
scanf("%d",&units);
if(units <= 100)
total_bill = units * 4;
else if(units <= 300)
total_bill = units * 4.5;
else if(units <= 500)
total_bill = units * 4.75;
else
total_bill = units * 5;
printf("the bill to be paid is = %f", total_bill);
getch();
}
No comments:
Post a Comment