4. Write a program to find and display the percentage difference, when:
(a) a number is updated from 80 to 90
(b) a number is updated from 7.5 to 7.2
Answers
Answered by
7
Answer:public class KboatPercentIncrease
{
public static void main(String args[]) {
int orgNum = 80;
int newNum = 90;
int inc = newNum - orgNum;
double p = inc / (double)orgNum * 100;
System.out.println("Percentage Difference = " + p + "%");
}
}
OUTPUT
Explanation:
Answered by
3
Answer:
class PerentChange
{
public static void main(double org, double New)
{
System.out.println("Original Number: "+org);
System.out.println("New Number: "+New);
double diff= New-org;
double perc= diff / (double)org * 100;
System.out.println("Percentage of Change: "+perc+"%");
}
}
Similar questions