Computer Science, asked by Cynthia35, 2 months ago

Write an algorithm to the enter the cost price and selling price of an item and display the profit or loss

pls answer this​

Answers

Answered by ak8651353377
0

Explanation:

The programming is done C++ language:-

# include <iostream.h>

# include <conio.h>

void main()

{

clrscr ( );

int a , b , profit_loss ;

cout << " Enter the cost price of the product " ;

cin >> a ;

cout << " Enter the selling price of the product " ;

cin >> b ;

profit_loss = b - a ;

if( profit_loss > 0 )

{

cout << " Profit = " << profit_loss ;

}

else

{

cout << " Loss = " << profit_loss ;

}

getch ( ) ;

}

Similar questions