Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerDivideAndRemainderExample2 { public static void main(String[] args){ // create 2 BigIntegerobjects BigInteger big1,big2; big1= new BigInteger("111"); big2= new BigInteger("0"); // BigInteger array bigArray stores result of big1/big2 BigInteger[]bigArray= big1.divideAndRemainder(big2); // print quotient and remainder System.out.println("Result of divideAndRemainderoperaion :"); System.out.println("Quotien tis "+ bigArray[0]); System.out.println("Remainder is "+ bigArray[1]); } }
Output