/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package bilanganpangkat;
import java.util.Scanner;
/**
*
* @author surur syifaus
*/
public class pangkat_iterasi {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner x=new Scanner(System.in);
int a,b;
System.out.println("angka dasar");
a=x.nextInt();
System.out.println("angka pangkat");
b=x.nextInt();
double c=( (Math.pow(a, b)));
if(b==0){
System.out.println("hasil = 1");
}
else{
System.out.println(""+c);
}
}
}
No comments:
Post a Comment