Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerModInverseExample4 { public static void main(String[] args) { //create 3 BigInteger objects BigInteger big1,big2,result; // initialize all BigInteger objects big1=new BigInteger("13"); big2=new BigInteger("-5"); //perform modInverse operation on big1 using big2 result=big1.modInverse(big2); String str=big1+"^-1 % "+big2+" is "+result; System.out.println(str); } }
Output