following program is compiled with zero errors but still i am getting wrong output
can anybody find where i am wrong so as to get correct output
[PHP]#include<iostre am>
using namespace std;
int main()
{
int units;
char name[20];
float cost,bill,total bill;
cout<<"enter the name"<<endl;
cin>>name;
cout<<"read units"<<endl;
cin>>units;
if(units<=100)
{
cost=(units*60/100);
bill=cost+50;
}
else if((units>100)& &(units<=200 ))
{
cost=(units*80/100);
bill=cost+50;
}
else if(units>=300)
{cost=(units*90/100);
bill=50+cost;
}
if(bill>300)
{
totalbill=bill+ bill*(15/100);
}
else
totalbill=bill;
cout<<"MR."<<na me<<"YOUR BILL IS "<<totalbill<<" Rs only"<<endl;
return 0;
] [/PHP]
can anybody find where i am wrong so as to get correct output
[PHP]#include<iostre am>
using namespace std;
int main()
{
int units;
char name[20];
float cost,bill,total bill;
cout<<"enter the name"<<endl;
cin>>name;
cout<<"read units"<<endl;
cin>>units;
if(units<=100)
{
cost=(units*60/100);
bill=cost+50;
}
else if((units>100)& &(units<=200 ))
{
cost=(units*80/100);
bill=cost+50;
}
else if(units>=300)
{cost=(units*90/100);
bill=50+cost;
}
if(bill>300)
{
totalbill=bill+ bill*(15/100);
}
else
totalbill=bill;
cout<<"MR."<<na me<<"YOUR BILL IS "<<totalbill<<" Rs only"<<endl;
return 0;
] [/PHP]
Comment