Computer Applications

Write a program to find and display the percentage difference, when a number is updated from 80 to 90

Java

Java Operators

140 Likes

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 + "%");
    }
}

Variable Description Table

Program Explanation

Output

Answered By

74 Likes


Related Questions