Created
May 23, 2022 14:28
-
-
Save lgolubyev/efd3c8b86b068e29d7cba082e19bfe85 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 % 2 != 0) | |
counter += element; | |
} | |
return counter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment