KnowledgeBoat Logo

Computer Applications

Write a program to find and display the value of the given expression:

a2 + b2 + c2 / abc;

taking the values a=5, b=4, c=3

Java

Java Operators

88 Likes

Answer

public class KboatExpression
{
    public static void main(String args[]) {
        int a = 5, b = 4, c = 3;
        double value = (a * a + b * b + c * c) / (double)(a * b * c);
        System.out.println("Result = " + value);
    }
}

Variable Description Table

Program Explanation

Output

BlueJ output of Write a program to find and display the value of the given expression: a 2 + b 2 + c 2 / abc; taking the values a=5, b=4, c=3

Answered By

45 Likes


Related Questions