17 % 5 example.... can't get it


#1

hey guys I'm at modulos and I got stuck, I mean can't understand why 17 % 5 answer is 2 ? 17 / 5 is 3.4, isn't it suppose to be 4? or 13 % 7 , it is 1.8577.... why it says 6 ?


#2

Because the remainder when 13 is divided by 7 is 6. % is the remainder operator in programming. A remainder is the residue of an integer division operation.

     1
  -----
7 ) 13
    -7
  -----
     6