For the following equation 3x4 + 4x3 + x2 + 7x + 9, take the value of x from the user and generate the result
Answers
Answered by
0
Answer:
sorry mera maths bada kharab he
Answered by
0
Program :
import java.util.*;
public class MyClass
{
public static void main(String args[])
{
Scanner Sc = new Scanner(System.in);
int x , Ans ;
System.out.print("Enter a value : ");
x = Sc.nextInt();
Ans = 3 * (int)Math.pow(x , 4) + 4 * (int)Math.pow(x , 3) + (int)Math.pow(x , 2) + 7 * x + 9;
System.out.print("For x = " + x + " result is " + Ans);
}
}
Output :
Enter a value : 2
For x = 2 result is 107
Similar questions
Computer Science,
1 month ago
Math,
1 month ago
English,
3 months ago
Math,
3 months ago
Social Sciences,
9 months ago
English,
9 months ago
Psychology,
9 months ago