Write a java program to evaluate the function
f(x)=(x²+1.5x+5)/(x-3) for all the values ranging from -10 to 10 by step 2
ie x=-10,-8,-6........6,8,10
Answers
Answered by
4
public class FunctionEvaluation {
public static void main(String[ ] args) {
for (double x = -10.0; x <= 10.0; x += 2.0)
System.out.printf("Value of x : %f%n Function evaluates to : %f%n%n", x, (x * x + 1.5d * x + 5) / (x - 3));
}
}
Similar questions