Finding the sum of even numbers using arrays
I'm working on a problem for my programming class at the moment and cant figure out how to determine if the number is even before including it in the sum. This is what I have so far, my compiler says there is an error with the if statement but I am not sure what else to do.
Any help would be appreciated. The goal is to find the sum of the even numbers.
int A, i, num, sum=0;
printf("Enter the value for A[%d]: ",i);
printf("The sum of the even numbers is %d.", sum);