public class pangkat2
{
public static void main (String [] args)
{
Scanner baca = new Scanner (System.in);
System.out.println ("Masukkan nilai x : ");
int x = baca.nextInt();
int pangkat = 2;
double y = Math.pow (x,pangkat);
System.out.println (" f(x) = x^pangkat + 2*(x) + 1");
System.out.println ((y)+" + "+(2*(x))+" + "+1+" = "+(y+2*x+1));
}
}
outputnya ;
Tidak ada komentar:
Posting Komentar