make a program that will compute and display the total amount of a purchased product
#include <iostream>
using namespace std;
int main(void)
{
int quantity;
float price, total;
cout<<"Total price of Item based on quantity\n";
cout<<"\nEnter price:";
cin>>price;
cout<<"\nEnter quantity: ";
cin>>quantity;
total = quantity * price;
cout<<"\nTotal = "<<total<<endl;
return 0;
}
Comments
Leave a comment