Saved Bookmarks
| 1. |
Predict the output of the following code. Justify. int k = 5; b = 0; b = k++ + ++k; cout<<b; |
|
Answer» Output is 12. In this statement first it take the value of k in 5 then increment it K++. So first operand for + is 5. Then it becomes 6. Then ++k makes it 7. This is the second operand. Hence the result is 12. |
|