i ‘am having some issues with my homework. the problem is Create a public static method int CountOddNumbers(int[] myArray) which returns the quantity of odd numbers that exist in myArray.
my code is:
public static int CountOddNumbers(int[] myArray){
for(int x = 0; x < myArray.Length; x++){
if(myArray[x] % 2 == 0){
Console.WriteLine(“{0} “, myArray[x]);
return myArray;
}
}
}
and i get the error cannot convert type int[] to int
any help? 🙁



