import java.math.BigInteger; import java.io.* ; public class bigintest { public static void main(String args[]) throws IOException{ String I1, I2 ; BigInteger b1, b2, b3 ; PrintWriter dos = new PrintWriter(System.out, true) ; System.out.println("\n\n") ; System.out.println(" *************************************************"); System.out.println(" * ------------------------------------ *"); System.out.println(" * BigInteger Consecutive Multiplicaton *"); System.out.println(" * ------------------------------------ *"); System.out.println(" * *"); System.out.println(" * by M. Gallant 10/14/97 *"); System.out.println(" *************************************************"); System.out.println("\n\n"); BufferedReader disys = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter first integer (I1):") ; I1=disys.readLine() ; System.out.println("\nEnter second integer (I2):") ; I2=disys.readLine() ; b1 = new BigInteger(I1) ; b2 = new BigInteger(I2) ; b3 = b1.multiply(b2) ; System.out.println("\n\n(I1 X I2) = " + b3) ; b3=b3.multiply(b3) ; // Square the previous result. System.out.println("\n\n(I1 X I2)^2 = " + b3) ; b3=b3.multiply(b3) ; // Square the previous result. System.out.println("\n\n(I1 X I2)^4 = " + b3) ; b3=b3.multiply(b3) ; // Square the previous result. System.out.println("\n\n(I1 X I2)^8 = " + b3) ; b3=b3.multiply(b3) ; // Square the previous result. System.out.println("\n\n(I1 X I2)^16 = " + b3) ; b3=b3.multiply(b3) ; // Square the previous result. System.out.println("\n\n(I1 X I2)^32 = " + b3) ; disys.close() ; } }