Time complexity of the following the code for(i = 1; i<=n;i++){for(int j=i+1;j<n-i;j++)}
Suppose $i=1$ then inner loop get executed $n-2$ times because of $2\leq j\leq n-1$ and $j $increment each step by one, As a result $n-1-2+1=n-2$ times inner loop executed.
If $i=2$ then inner loop executed $n-4$ times ... until $i=\frac{n}{2}$ inner loop executed 1 time.




Value of $i$
#inner loop executed




$i=1$
$n-2$


$i=2$
$n-4$


$i=3$
$ n-6$


...
...


$i=\frac{n}{2}$
$n-(n-1)$




It's equal to following summation:
$\frac{n}{2}\times n-2\sum_{i=1}^{\frac{n}{2}}i=\frac{n^2}{2}-\frac{n\times(\frac{n}{2}+1)}{2}=O(n^2)$