7/22 To divide this, first we find the integer portion of the answer 7/22 = 0. 7%22 = 7, and we use 7 to find the decimal portion of the answer: Make an array: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 -1's across the board 7 is the remainder we've come across, I will put a 0 in position 7. (So the array is all -1's EXCEPT that A[7] is 0.) Now I compute 7*10 % 22. 70 %22 = 4. Set A[4] to 1. 7*10 / 22 = 70/22 = 3. Append to the answer string: "3" My new remainder is 4. 4*10%22 = 40%22 = 18. A[18] to 2. 4*10/22 = 40/22 = 1. Append to the answer string: "31" My new remainder is 18. 18*10%22 = 180%22 = 4. A[4] has already been used. It's not -1 anymore, it's 1. 18*10/22 = 180/22 = 8. Append to the answer string: "318" Since I have a repeated remainder, I don't do many division. Since A[4] = 1, There is one in the answer string that comes before the (. "3(18)" The integer answer was 0, so the total is now 0.3(18) Compute 17/7: Integer division 17/7 = 2. 17%7 = 3, so this will be our starting remainder. Initialize an array of size 7 to all -1's Set A[3] to 0. 3*10/7 = 30/7 = 4 Answer string:"4" 3*10%7 = 30%7 = 2 Set A[2] to 1. 2*10/7 = 20/7 = 2 Answer string:"42" 2*10%7 = 20%7 = 6 Set A[6] to 2. 6*10/7 = 60/7 = 8 Answer string:"428" 6*10%7 = 60%7 = 4 Set A[4] to 3. 4*10/7 = 40/7 = 5 Answer string:"4285" 4*10%7 = 40%7 = 5 Set A[5] to 4. 5*10/7 = 50/7 = 7 Answer string:"42857" 5*10%7 = 50%7 = 1 Set A[1] to 5. 1*10/7 = 10/7 = 1 Answer string:"428571" 1*10%7 = 10%7 = 3 But A[3] is already 0, it's not -1 anymore. Since A[3] is 0, there are 0 characters before the (. 2.(428571)