Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
int a=2; printf("%d", ++a + a++);
+26
votes
asked
Jun 18, 2019
by
kj
closed
Dec 27, 2021
by
Admin
closed with the note:
answered
urgent
38 Answers
–1
vote
answered
Jul 4, 2019
by
anonymous
Answer is 6.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Jul 5, 2019
by
anonymous
answer would be 6
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Jul 6, 2019
by
anonymous
a=2
++a=2+1=3
a++=3
++a+a++=3+3=6
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Jan 17, 2020
by
Warisha Laique
(
300
points)
++a=3
a++=2
++a + a++ =3+2 =5
output:5
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Jan 20, 2020
by
VINIT SAMMIR
(
240
points)
6, beacuse first increase and after then add icrease value
3+3=6
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Jan 23, 2020
by
Ramesh Yedage
(
130
points)
int a=2;
a++=2+1=3
++a=3
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Jan 27, 2020
by
Parth Ahluwalia
this is a problem of post and pre increment so the answer is 6
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Jan 31, 2020
by
teja sree
(
360
points)
answer is:6 first it is preincrement so the value is incremented and assigned to a. Next as it is post increment it assigns the value and the value of a will be incremented.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Feb 2, 2020
by
VINIT SAMMIR
(
240
points)
the ans is seven beacuse first it check right and thencheck left
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
–1
vote
answered
Feb 3, 2020
by
Aparna Tripathi
(
160
points)
++a=3,a++=2
i.e 5
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Page:
« prev
1
2
3
4
next »
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...