hello,
i have written the below piece of code for calculating the power function, but when i run the program, it shows the wrong result and i verified it by calculating manually. so please help me to get the correct result.
public class powerFunction
{
public static void main(String ar[])
{
int c = 11;
int d = 23;
int n = 187;
long dt;
dt = (long)((Math.pow(c,d)) % n);
System.out.println("dt =" +dt);
}
}
The output should be 88, but it is displaying 149.