Showing posts with label Calculate Electric Energy Bill in C. Show all posts
Showing posts with label Calculate Electric Energy Bill in C. Show all posts

Monday, August 27, 2012

Calculate Electric Energy Bill

/*****<soeasyprograms.blogspot.in>*****/
#include<stdio.h>
#include<conio.h>
void main()
{
float r,a=2.5,b=3.5,c=1.5;
clrscr();
printf(“enter the readings\n”);
scanf(“%f”,&r);
if(r>=200)
printf(“rupees=%f”,r*b);
else if((r>=100)&&(r<200))
printf(“rupees=%f”,r*a);
else
printf(“rupees=%f”,r*c);
getch();
}

Output:
enter the readings
140
rupees=350