Why does this work
for(int i=0;i<15;i++){
    if(i%2==0)
        even+=ar[i];
    else
        odd+=ar[i];
}
but not this??
for(int i=0;i<15;i++)
    i%2==0?even+=ar[i]:odd+=ar[i];
Can ternary not be used this way or have I made an error that I can not spot?