public static void main(String args[]) { int num = 2; int pow = 5; System.out.print(power(num , pow)); } public static int power(int a , int b) { int power = 1; for (int c = 0; c < b; c++) power *= a; return power; }