19. Initially j is 20 and p is 4, then what will be the value of
p = p* ++j;?
Answers
Answered by
14
Answer:
84
Explanation:
4*++20 so It,ll increment first and make it 21 ...21*4 is 84
Answered by
2
The value of p = p* ++j is 84.
- Initially, the value of j is 20, and that of p is 4.
- The value of p is multiplied by ++j, which is then allotted to the p variable.
- Here, the ++j represents, that the value of j is first increased by one and then used in the equation.
- If it mentioned, j++, then it would be that the value of j is used first in the equation and then increased.
- But here, ++j is used, earlier the value of j was 20, by increasing it with 1 we get 21.
- We have to multiply 21 by the value of p, to get a new value of p.
- So, my multiplying 21 and 4, we get 84, which will be assigned to p.
Hence, the value of p = p* ++j is 84.
#SPJ3
Similar questions