Please give the output of the following.
int al={1,2,3,4,5);
int p=0;
Sopln(++a[p]);
Sopln(++a[++p]);
Answers
Answered by
0
Answer:
2
3
Explanation:
As ++ before a variable increments its value before any operation is applied on it, thus in this case a[p] or pth or 0th value in array 'a' was 1. But due to the increment it became 2. And similarly in ++a[++p], first p is incremented from 0 to 1 and the 1th place in the array 'a' (i.e. 2) is incremented and it becomes 3.
Answered by
1
SOLUTION
2
3
HOPE it helps
Similar questions
World Languages,
17 days ago
Math,
17 days ago
Geography,
1 month ago
Math,
9 months ago
Physics,
9 months ago