43. Write a program to input selling price and cost price calculate profit or loss percentage.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)

Algorithm:

Step 1: Start

Step 2: Input cost price and selling price (cp, sp)

Step 3: If cp > sp Then

GoTo Step 4

Else if cp < sp GoTo Step 5

Else GoTo Step 6

Step 4: LP = ((cp – sp) / cp) * 100

GoTo Step 7

Step 5: PP = ((sp – cp) / cp) * 100

GoTo Step 8

Step 6: Print Neither Profit or Loss

GoTo Step 9

Step 7:Print Loss Percentage is : LP

GoTo Step 9

Step 8: Print Profit Percentage is : PP

Step 9: Stop/End

Flowchart:

Create a flowchart to input selling price and cost price calculate profit or loss percentage
Create a flowchart to input selling price and cost price calculate profit or loss percentage
Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

42. Write a program to input number as paise and convert into rupees only.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)

Next Post

44. Write a program to input the day and display whether the day is Saturday or not?(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)

Related Posts