35.7k views
1 vote
5. Write a C++ program that can display the output as shown below. Your

program will calculate the price after discount. User will input the
price and the discount is 20%




5. Write a C++ program that can display the output as shown below. Your program will-example-1
User David Cram
by
8.4k points

1 Answer

0 votes

Answer:

#include<iostream>

using namespace std;

int main()

{

float price;

float discount;

cout<<"enter price : ";

cin>>price;

discount=price - (price * 20 / 100);

cout<<"discount rate is :"<<discount;

}

Step-by-step explanation:

User CorPao
by
8.5k points