for ( i = n , j = 0 ; i > 0 ; i = i / 2 , j = j + i ) ;
All variables are integers.(i.e. if decimal values occur, consider their floor value)
Let $\text{val}(j)$ denote the value of $j$, after the termination of the loop. Which of the following is true?
(A)$\quad \text{val(j)} = \Theta(\log(n)) $
(B)$\quad \text{val(j)} = \Theta(\sqrt n) $
(C)$\quad \text{val(j)} = \Theta(n) $
(D)$\quad \text{val(j)} = \Theta(\log\log n) $
Please explain, is there any easy way to guess the value of $j$?