import java.math.BigInteger;
public class Program {
public static BigInteger poweBigInteger(int base, int exponent) {
BigInteger power = BigInteger.valueOf(base).pow(exponent);
return power;
}
public static void main(String[] args) {
int base = 2; int exponent = 15;
System.out.println("Sum of digits of 2^15 is: " + poweBigInteger(base, exponent));
base = 2; exponent = 100;
System.out.println("Sum of digits of 2^100 is: " + poweBigInteger(base, exponent));
}
}
/*
run:
Sum of digits of 2^15 is: 32768
Sum of digits of 2^100 is: 1267650600228229401496703205376
*/