What is the time complexity of this nested loop code?
We just have one comparison when  $n$ is odd. So, the total complexity is (if we suppose $n$ is even, w.l.o.g.):

$$T(n) = \frac{n}{2} + (n +‌ (n-2) + (n-4) + ... + 2) $$
$$= \frac{n}{2} + 2 \sum_{i=1}^{\frac{n}{2}}i = \frac{n}{2} + 2\frac{\frac{n}{2}(\frac{n}{2}+1)}{2} = \Theta(n^2)$$