C Program to enter meter reading,calculate the cost and print out
how much is charged
#include
#include
void main()
{
float mr,n,cost;
clrscr();
printf("\nEnter the meter reading:");
scanf("%f",&mr);
if(mr<=500)
{
printf("cost=10",cost);
}
else if((mr>500)&&(mr<=1000))
{
n=mr-500;
cost=10+n;
printf("cost=%0.2f",cost);
}
else
{
n=mr-1000;
cost=35+(2*n);
printf("cost=%0.2f",cost);
}
getch();
}
***********OUTPUT********
enter the meter reading:510
cost=20.00
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Wednesday, December 31, 2008
C Program to enter meter reading,calculate the cost and print it out
Posted by ars at 11:58 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment