package javaapplication1;
public class JavaApplication1 {
public static void main(String[] args) {
int exponent = 4, n = 2, i = 1, power = 1;
while (i <= exponent)
{
power = power * n;
i++;
}
System.out.format("%d ^ %d = %d\n", n ,exponent, power);
}
}
/*
run:
2 ^ 4 = 16
*/