pragma solidity ^0.8.11;
contract MyContract {
uint[] public numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
function countEvenNumbers() public view returns (uint) {
uint count = 0;
uint i = 0;
while(i < numbers.length){
if(isEvenNumber(numbers[i])) {
count ++;
}
i ++;
}
return count;
}
function isEvenNumber(uint _number) public view returns(bool) {
return (_number % 2 == 0 ? true : false);
}
}