Â
In this, we are going to write a simple program to find the Profit and Profit Percent in Java.
class Profit
{
public static void main(String[] args
)
{
float selling_price = 10000, cost_price = 7000, profit, profit_percent;
profit = selling_price - cost_price;
profit_percent = profit / cost_price * 100;
System.out.println("Profit = " + profit);
System.out.println("Profit Percent = " + profit_percent);
}
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP