Computer Science, asked by sangitajana2007, 3 months ago

public class profit_loss
{
public static void main (int cp,int sp)
{
double p = 0 , l = 0, pp = 0 , lp = 0 ;
if (sp > cp )
{
p = sp - cp ;
pp = (p/cp)*100.0 ;
System.out.println("the profit is "+p) ;
System.out.println("the profit percentage is "+pp);
}
elseif (cp > sp ) ;
{
l = cp - sp ;
lp = (l / c)*100.0 ;
Sysytem.out.println("the loss is "+l ) ;
Sysytem.out.println("the loss percentage is "+lp );
}
else
{
System.out.println("there is neither profit nor loss ");
}

}
}

Answers

Answered by ShahHet
0

Answer:

what do you want in this??????

Similar questions