title: Integer division returns 0 in C
body: <p>An integer division caused by the elements of an array returns 0, I'm supposed to store the % in the same array....</p>
  
  <pre><code>array[6][i]=array[5][i]/total;
  </code></pre>
  
  <p>This stores a 0... I thought it had something to do with the array being an integer array... so I did a cast...</p>
  
  <pre><code>array[6][i]=(int)(array[5][i]/total); 
  </code></pre>
  
  <p>Still stored 0... I read I had to convert them to floating points but the casting doesn't work... I tried this</p>
  
  <pre><code>array[6][i]=(int)((float)array[5][i]/(float)total); 
  </code></pre>
  
  <p>the array declaration</p>
  
  <pre><code>int arreglo[7][5]={{1,194,48,206,45},{2,180,20,320,16},{3,221,90,140,20},{4,432,50,821,14},{5,820,61,946,18},{0,0,0,0,0},{0,0,0,0,0}};
  </code></pre>
  
  <p>and the last one will store each percentaje</p>