[prev] 41 [next]

Exercise #2: What are the final values of a and b?

  1. a = 1; b = 7;
    while (a < b) {
       a++;
       b--;
    }
    

  2. a = 1; b = 5;
    while ((a += 2) < b) {
       b--;
    }