java program to calculate power of a given number code example Example: how to find powers in java int n=Math.pow(N, P);