Computer Science, asked by asmitaghosh249, 1 month ago

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 prateekpal2002pcizsq
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 Mkai3
1

SOLUTION

2

3

HOPE it helps

Similar questions