Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerDivideAndRemainderExample1 { public static void main(String[] args){ // create 2 BigIntegerobjects BigInteger big1,big2; big1= new BigInteger("-111"); big2= new BigInteger("3"); // 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("Quotient is "+ bigArray[0]); System.out.println("Remainder is "+ bigArray[1]); } }
Output