Time complexity of a triple-nested loop
You can count the number of times the innermost for loop is executed by counting
the number of triplets $(i,j,k)$ for which it is executed.

By the loop conditions we know that: $1 \leq i \leq j \leq k \leq n$ . We can reduce it to the following simple combinatorics problem.


Imagine $n+2$ boxes of red colour placed in an array from left to right.
Pick any 3 boxes from the $n+2$ boxes and paint them blue.
Form a triplet $(i,j,k)$ as follows:

$i$ = 1 + number of red coloured boxes to the left of first blue box.
$j$ = 1 + number of red coloured boxes to the left of second blue box.
$k$ = 1 + number of red coloured boxes to the left of third blue box.



So, we just need to count the number of ways of picking 3 boxes from $n+2$ boxes which is $n+2 \choose 3$.