There are $6$ instances of addition
- $i++$
- $j++$
- $k++$
- $i+j(\text{let it be s})$
- $s+k$
- $d+1$
We have to count how many times each of them is calculated.
d=d+1
First of all we will calculate number of additions of $d+1$, it will on the other hand signify the overall time complexity of the code.
it will be $\frac{n \times n \times n }{2}=O(n^3) \Rightarrow \frac{20 \times 20 \times 20 }{2} =4000$
i+j+k
Number of addition =$2 \times n \times n \times n=16000$
i++
$20 \text{times}$
j++
$20 \times 20=400\text{times}$
k++
$20 \times 20 \times 20=8000\text{times}$
Total number of additions$=4000+16000+20+400+8000=28420$