Computer Science, asked by simlaswarnakar30, 25 days ago

2)
8. int a=7, p=0, q=0; p= + + a + -- a; q = p; The output of q will be:
(b) 14
(c) 15
(d) -15
(a) 13​

Answers

Answered by BrainlyProgrammer
15

Intially, a=7,p=0,q=0

____

p= + + a + -- a; \\ p = 8 + 7 \\ p = 15 \\

Now, \\  \sf \: q = p \\  \therefore \: q = 15

Correct Answer:-

  • Option C: 15

Always remember:-

  • ++a or --a is a prefix increment/decrement operator which means increase then calculate.
  • a++ or a-- is a postfix increment/decrement operator which means first calculate then increase.
Similar questions