Tuesday, 4 October 2016

To find Electricity charge if Units consumed is given .

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,b,c;
cout<<“Enter Units Consumed “<<“\n”;
cin>>a;
b=a>300?60:(a>100?50:(a<=100?40:0));
c=(b*a)+50;
cout<<"Fixed charge imposed = 50 ";
cout<<“Electricity Charge imposed =”<<b<<” per Unit”<<“\n”;
cout<<“Payable Amount = Rs.”<<c;
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...