you need to do this then

c = (int)x%(int)y; //cast the other two vars as ints mod won't work for floats