9. Write a Java program to calculate profit or loss. Static Solution :- class profitloss { public static void main(String args[]) { int amount,cp=2000,sp=1500; if (sp > cp) { amount = sp - cp; System.out.println("Profit :- "+amount); } else if(cp > sp) { amount = cp - sp; System.out.println("Loss :- "+amount); } else { System.out.println("No profit no Loss" ); } } } Output :- Dynamic Solution:- import java.util.*; class profitloss { ...
All computer course for class 9th to 12th with proper practical and theory .........