import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Input x : ");
int x = in.nextInt();
System.out.print("Input n : ");
int n = in.nextInt();
System.out.print("Input y : ");
int y = in.nextInt();
double result = Math.pow(x, n);
double result1 = result % y;
System.out.println("x^n % y = " + result1);
}
}
Output:
Input x : 25
Input n : 35
Input y : 45
x^n % y = 5.0
Code:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer