5. Write a Java Program to calculate the profit percent of the sale, where cost price of an Item and sold
price are to be input by user using Scanner class. Display the result with appropriate label.
Formula for profit percent :
profit in % = profit/C.P * 100
where profit = S.P. - C.P
Answers
Answered by
3
Answer:
class num
{
void main(cp,sp)
{
int profit,profit%;
cp=75,sp=100;
profit=sp-cp;
{
system.out.println(profit);
}
profit%=profit/cp*100;
{
system.out.println(profit%);
}
}
}
Similar questions