Thursday, 19 July 2018

Discount at Shop

===========================================================================
                                CODING



#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{
clrscr();

int p;
cout<<"\n Enter your purchase amount: ";
cin>>p;
if(p>=0 && p<=1000)
{cout<<"\n You have to pay 10% less i.e.: "<<(p-p*0.1)<<" Please visit again!";}
else if(p>1000 && p<=2000)
{cout<<"\n You have to pay 20% less i.e.: "<<(p-p*0.2)<<" Please visit again!";}
else
{cout<<"\n You have to pay 30% less i.e : "<<(p-p*0.3)<<" Please visit again!";}
getch();
}

===========================================================================


                                OUTPUT


No comments:

Post a Comment