Computer Applications
Write a program to find and display the percentage difference, when a number is updated from 80 to 90
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
Related Questions
Write a program to find and display the percentage difference, when a number is updated from 7.5 to 7.2
The normal temperature of human body is 98.6°F. Write a program to convert the temperature into degree Celsius and display the output.
Hint: c / 5 = f - 32 / 9
A person is paid ₹350 for each day he works and fined ₹30 for each day he remains absent. Write a program to calculate and display his monthly income, if he is present for 25 days and remains absent for 5 days.
In a competitive examination, there were 150 questions. One candidate got 80% correct and the other candidate 72% correct. Write a program to calculate and display the correct answers each candidate got.