Created
May 23, 2022 14:28
-
-
Save lgolubyev/6f69856f3bb135cdfbec1d931bb9b0f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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