KnowledgeBoat Logo

Computer Applications

Write a program to calculate and display the value of the given expression:
(a2+b2)/(a-b),when a=20, b=15

Java

Input in Java

48 Likes

Answer

public class KboatEvalExp
{
    public static void main(String args[])
    {
        int a = 20, b = 15;
        double result;
        result = (a * a + b * b) / (a - b);
        System.out.println("Result = " + result);
    }
}

Output

BlueJ output of Write a program to calculate and display the value of the given expression: (a 2 +b 2 )/(a-b),when a=20, b=15

Answered By

28 Likes


Related Questions