Hi Guys
How to calculate the N to the power of N ,
public class ForCycle_04 {
public static void main(
String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("begin");
int num = sc.nextInt();
System.out.println("end");
int power = sc.nextInt();
int result = 1;
for (int i = 0; i < power; i++) {
result = result * num;
}
System.out.println(result);
}
}
if N == 64 return 0 , please give me a solution.
Thanks in advance!