#include <iostream>
using namespace std;
int main()
{
int arr[10] = {1,2,3,4,5,6,-7,8,-9,10};
int checkNeg = 0;
for(int i =0; i <10; i++){
if((arr[i] < 0) && ((arr[i] % 2) == 1) ){
checkNeg++;
}
}
cout << checkNeg;
}
Why am I getting 0? I am trying to write program which will print number of negative odd numbers.