37. Profit or Loss

Acceptance — 0 accepted 0 submissions

Easy
ConditionalsMath
No companies listed
Gopal buys vegetables wholesale and sells them in the local market.

Given the cost price and the selling price, tell him whether he made a profit or a loss, and how much.

Input Format
A single line with two integers: cost price C and selling price S.

Output Format
Print Profit <amount>, Loss <amount>, or No Profit No Loss.

Constraints
• 1 ≤ C, S ≤ 10^6

Example 1

Input
500 650
Output
Profit 150

Explanation Sold for more than cost: 650 - 500 = 150 profit.

Example 2

Input
800 720
Output
Loss 80

Explanation Sold for less: 800 - 720 = 80 loss.

Example 3

Input
300 300
Output
No Profit No Loss

Explanation Same price, so neither profit nor loss.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
Profit 150
No results yet
Run your code to test it against the sample cases.
Problem List