Back to Practice
#0160

Profit After Discount

MediumAptitude25 min20 XP

Problem

An item has cost price 800 and marked price 1000. It is sold at 10% discount. Find profit percentage.

Why This Matters

Discount questions test whether you apply percentages to the marked price, not the cost price.

Examples

Example 1
InputCP = 800, MP = 1000, discount = 10%
Output12.5%

Selling price = 900. Profit = 100. Profit percentage = 100/800 * 100 = 12.5%.

Constraints

  • Return the exact requested value.
  • Handle empty or small inputs when the prompt allows them.
  • Keep the code readable and deterministic.
CodeReasoning
An item has cost price 800 and marked price 1000. It is sold at 10% discount. Find profit percentage.
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core example
InputCP = 800, MP = 1000, discount = 10%
Expected12.5%

Selling price = 900. Profit = 100. Profit percentage = 100/800 * 100 = 12.5%.

Hidden Test Categories
empty or smallest inputduplicates or repeated valueslarger realistic input