C++ Program – Calculate Electricity Bill

by Nideesh C on May 1, 2011 · 0 comments

in C++




/* c++ program to calculate electricity bill using if */

 #include<iostream.h>
 #include<conio.h>
 void main()
 {
 clrscr();
 float r,a,u;
 cout<<"Enter Your Rn + Elec Bill"<<endl;
 cin>>r>>u;
 if(a<=100)
 a=u*.40+50;
 else
 if((u>100) && (u<=300))
 a=100*.40 + (u-100)*.50 + 50;
 else
 a=(100*.4 + 200*.50 + (u-300)*.60 + 50);
 cout<<"Bill = "<<a;
 getch();
 }  



Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Sample – Program to enter the unit reading and output the customer’s telephone bill.
  2. C++ program – Swap two variables using function overloading
  3. C++ program – Implementation of class
  4. Sample – Program to draw circles.
  5. C++ program – calculate the factorial of a number using recursion.

Leave a Comment

Previous post:

Next post: