ax^2+bx+c give the java expression
Answers
Answered by
2
Answered by
13
Correct Question:-
- Write the Java Expression for: ax^2+bx+c
Answer:-
This can be done in two ways:-
- a*(Math.pow(x,2))+ (b * x) +c
- a * (x * x)+(b*x) + c
_
Note:-
- Math.pow() returns double data type value
- It returns a number raised to power other number. Example:
- You can also write Math.pow(x,2) as x * x [As given in Point 2 of the answer]
- To return the output in integer data type you can use type casting. Example: (int)(Math.pow(x,2))
Similar questions