here pro[] is same in both the logic case and have all positive number(and /or may have zero). I was trying to implement that if the modulus by 4 of array elements is not equal to 2 then the count will increase by 1.

logic 1:

for(p=0; p<k; p++)

{

if(pro[p]%2==0)

{

if(pro[p]%4==0)

{

count++;

}

}

else

{

count++;

}

}

logic 2:

for(p=0; p<k; p++)

{

if(pro[p]%4 !=2)

{

count++;

}

}

logic 1 got accepted but logic 2 shows wrong answer.