Create a free account on Computer Sir Ki Class and unlock access to valuable learning resources.
Exam Paper Downloads: After registering and logging in, you can download exam question papers in PDF format to practice and prepare for your exams.
Student Support: Get assistance with your doubts, queries, and questions related to your studies. Our support is here to help you understand topics and resolve your learning difficulties.
Register today and make your exam preparation easier and more effective!
Give the output of the following expression :
a+=a++ + ++a + -–a + a-– ; when a = 7
Answer:
Doing it step by step:
a=7;
a+=a++ + ++a + -–a + a-– ;
the assignment will happen at last so we will do for RHS first
Step 1: 7 + 9 + 8 + 8 //Second number will increment twice one due to previous post increment and then due to current pre increment. Last post decrement will not have any effect.
Step 2: 32
Step 3: a+=32 //with a still as 7 as it was part of assignment
Step 4: a = 39 //final answer
C. Sir| Created: 31-Mar-2018 | Updated: 21-Apr-2026|ICSE2016