/*Write a C++ program to input the total amount in a bill, if the amount is greater than 1000, a discount of 8% is given. Otherwise, no discount is given. Output the total amount, discount and the final amount.*/
#include<iostream.h>
#include<conio.h>
void main( )
{
float amount, discount=0.0, netdiscount,netamount ;
clrscr( );
cout<<"Enter amount"<<endl;
cin>>amount;
if(amount>=1000.0)
discount = 8.0/100.0;
netdiscount=amount*discount;
netamount=amount-netdiscount;
cout<<"Net discount="<<netdiscount<<endl;
cout<<"Net amount="<<netamount<<endl;
getch( );
}

No comments: