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

42 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

Answered By

24 Likes


Related Questions