This works, k increments:

```
k = 0;
k = ( false condition here ) ? 0 : k+=1;

```

This works, k increments:

```
k = 0;
k = ( false condition here ) ? 0 : ++k;

```

**This does not work, k is always 0:**

```
k = 0;
k = ( false condition here ) ? 0 : k++;

```

Can someone explain what's going on under the hood?

EDIT:
I don't need alternative ways to write this. 
I don't care if this can be written in a simpler way.

In a for loop either i++ or ++i works. 
Why the behaviour here is different?