Write a program using variables to find the profit and profit percent of a certain transaction where S.P=Rs10000 and C.P=Rs7000
Answers
Answered by
1
Answer:
cp = 7000
sp = 10000
p = 10000 - 7000
pp = p / cp * 100
print("profit is", p)
print("profit percent is", pp)
Answered by
2
- Write a program using variables to find the profit and profit percentage of a certain transaction where SP=₹10000 and CP=₹7000
Profit is calculated by using the formula,
Profit=SP-CP
Profit Percentage = Profit/CP * 100%
So, here is the code given.
class Profit
{
public static void main(String s[])
{
double sp=10000.0;
double cp=7000.0;
double p=sp-cp;
double pp=p/cp *100;
System.out.println("Profit: "+p);
System.out.println("Profit percentage: "+pp);
}
}
Similar questions