title: Attempting for loop with if-thn statement so that my desired value is surpassed by the value in the for loop
body: <p>I'm working with a program so that it will be able to take a two values, and multiply the difference by the first power of ten above the sum and then add the sum.  So for 5 and 3, it would be 2 * 10 + 8 = 28.  This only works when the sum &lt; 10.  I am wondering if anybody can help to make the else portion of the if-then-else statement to work so than one where 9 and 1 and other values can be input so then the other half of the program will work.</p>
  
  <p>import java.util.Scanner;</p>
  
  <pre><code>public class StrangeCalculation {
      public static void main(String[] args) {
          Scanner input = new Scanner(System.in);
          System.out.println("What is the first number?");
          int num1 = input.nextInt();
          System.out.println("What is the second number?");
          int num2 = input.nextInt();
          int min = Math.min(num1, num2);
          int max = Math.max(num1, num2);
          int sum = min + max;
          int diff = max - min;
          int a = 1;
          if (sum &lt; Math.pow(10, a + 1)) {
              int strangeValue = (int) (Math.pow(10, a) * diff + sum);
              System.out.println("The value is:  " + strangeValue);
          }
          else {
              for(int i = 0; i &lt; 3; i = 10 * i) {
                  //Loop until the sum value can be exceeded
              }
          }
      }
  }
  </code></pre>