SAMPLE 001

Description:

Write a program to calculate the total expenses. Quantity and price per item are input by the user and discount of 20% is offered if the expense is more than 10000. Test Case 1 Input (stdin) 50 1000 Expected Output Total Expense is Rs. 40000 Test Case 2 Input (stdin) 10 1000 Expected Output Total Expense is Rs. 10000

Program :


#include <iostream>

using namespace std;

int main()

{

   int a,b,c,d;

  cin>>a>>b;

  c=a*b;

  if(c>10000)

  {

    d=(c/5)*4;

    cout<<"Total Expense is Rs. "<<d;

  }

  else

  {

    cout<<"Total Expense is Rs. "<<c;

  }

return 0;

}