Youve been hired by Number Knights to write a Java console a
You\'ve been hired by Number Knights to write a Java console application that investigates how well Java handles large integers. Write two loops that iterate from 0 through 35. Before each loop, set an integer variable (IV) to 1. Within each loop, print the loop count and the value of IV formatted in two columns. Within the first loop, multiply IV by 2. Within the second loop, multiply IV by the appropriate StrictMath method. The second loop will not complete since there will eventually be an integer overflow.
Solution
public class Test{
    public static void main(String args[]){
        int iv = 1;
        for(int i = 0; i <= 35; i++){
            System.out.printf(\"%d\\t%d\ \", i, iv);
            iv *= 2;
        }
        System.out.println();
        iv = 1;
        for(int i = 0; i <= 35; i++){
            System.out.printf(\"%d\\t%d\ \", i, iv);
            iv = (int) StrictMath.pow(2, i);
        }
    }
 }

