WAP to input CP and SP and check profit or loss. Also find profit or loss amount.
1 year ago
OOP Java
Compile code:
class Profitorlossamt{
public static void main(String[] args) {
float cp=550,sp=50,profit,loss;
profit=sp-cp;
loss=cp-sp;
System.out.println("The profit amount is Rs. "+profit);
System.out.println("The loss amount is Rs. "+loss);
}
}
Output:
Dipti KC
Jan 8, 2023