can anyone help me with this java question
Attachments:
Answers
Answered by
4
CODE :
import java.util.*;
class sample
{
public void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number of x");
double x=sc.nextDouble();
double y=0.0;
y=Math.pow(x,1.0/6.0)+Math.pow(x,1.0/4.0)+Math.sqrt(x))+10.0)/((Math.pow(x,1.0/5.0)+(Math.pow(x,1.0/3.0)+x);
System.outprintln("The value of y is "+y);
}
}
How to take the n th root ?
The function of power says :
Math.pow(x,n) = x^n .
Hence we can implement the same logic here :
Math.pow(x,1/n) = n th root of x .
This is the basic logic applied .
Note that the brackets must be there so that the whole numerator is divided by the denominator.
Similar questions