Question 5
Write a program in Java to calculate and display the value of the given expressic
1/a*a+1/b*b*b+1/c*c*c*c
Take the value of a, b and c as inputs.
Answers
Answered by
0
Answer:
java programming is the answer
Answered by
1
Answer:
import java.util.*;
class expression
{
public static void main ()
{
Scanner sc=new Scanner (System.in);
double a,b,c; /*taking a double because int can result as improper value*/
System.out.println ("Enter 3 numbers");
a=sc.nextDouble(); //inputting3 values from user
b=sc.nextDouble();
c=sc.nextDouble();
System.out.println ("Required Result: "+(1/a*a+1/b*b*b+1/c*c*c*c)); //printing the result
}
}
Explanation:
hope this helps you please mark it the brainliest
Similar questions