import java.util.*;
class lossprofit
{
public static void main(string args[])
{
int cp,sp;
scanner os= new scanner(system.in);
cp =os.next int();
sp =os,next int();
system.out.println("cost price :" +cp);
system.out.println("selling price :" +sp);
if ((cp >sp))
system.out.println("loss amount :" +(cp-sp));
else
system.out.println("profit amount :" +(sp-cp));
}
}
class lossprofit
{
public static void main(string args[])
{
int cp,sp;
scanner os= new scanner(system.in);
system.out.println("enter cost price, selling price");
system.out.println("even number");cp =os.next int();
sp =os,next int();
system.out.println("cost price :" +cp);
system.out.println("selling price :" +sp);
if ((cp >sp))
system.out.println("loss amount :" +(cp-sp));
else
system.out.println("profit amount :" +(sp-cp));
}
}
No comments:
Post a Comment