Topical Information

Here are a few questions to help you clarify your understanding of the shorthand operators.

Question Set Information

Questions

  1. Express each of the following expressions in terms of the short-hand operators. Show ALL possible translations! (All of the variables used are of an integral type.)

    1. x = y * x

      
              x *= y
      
      
    2. c = c % (u - 4)

      
              c %= u - 4
      
      
    3. i = 1 + i

      
              i += 1            i -= -1            i++               ++i
      
      
    4. j = -1 + j

      
              j -= 1            j += -1            j--               --j
      
      
    5. k = -3 + k

      
              k += -3            k -= 3
      
      
    6. x = (8 - y) * x + z / 12

      
              x *= 8 - y;
              x += z / 12;
      
      
  2. Express each of the following expressions in terms of the normal operators.

    1. x /= z - 2

      
              x = x / (z - 2)
      
      
    2. a += 3 - b

      
              a = a + 3 - b
      
      
    3. q++

      
              q = q + 1
      
      
    4. p--

      
              p = p - 1
      
      
    5. u %= i + 6 / p

      
              u = u % (i + 6/p)
      
      
    6. h -= y * 2;
      h += 4 / q;

      
              h = h - y*2 + 4/q;