power function in java for integer numbers code example Example: how to find powers in java int n=Math.pow(N, P);