Integer division returns 0 in C
问题 An integer division caused by the elements of an array returns 0, I'm supposed to store the % in the same array.... array[6][i]=array[5][i]/total; This stores a 0... I thought it had something to do with the array being an integer array... so I did a cast... array[6][i]=(int)(array[5][i]/total); Still stored 0... I read I had to convert them to floating points but the casting doesn't work... I tried this array[6][i]=(int)((float)array[5][i]/(float)total); the array declaration int arreglo[7]