Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private static int SumOdd(int[] array)
{
int counter = 0;
for (int i = 0; i < array.Length; i++)
{
var element = array[i];
if ((element & 1) == 1)
counter += element;
}
return counter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment