% is an operator
A binary operator takes two operands, in your example, they are c and 2.
The message is saying that both of these should be integers. For example, 3 % 2. However your code uses a double and an integer (for example 3.14 % 2) which is not allowed.
This would compile:
1 2
int c = y[k];
if (c % 2 == 1)
but it may not make sense - for example if y is an array of doubles, the conversion will lose the non-integer portion, so for example if y[k] had the value 3.14 or even 3.99, the value would be truncated to just 3 when storing it in int c.