0
Please explain the output
int a= 30; int b=6; cout << a/b--;
4 Answers
+ 5
B decrements to 5 after the statement has finished,if you print the result 2 times you will see this.
+ 2
Thirteen post decrement operator is used here(not pre-decrement) so the value of *b* will be decremented after the calculation of "a/b" thus the answer should be 5 instead of 6.
Here is a working sampleđ
https://code.sololearn.com/cT7TwS7bMZ23/?ref=app
+ 1
What do you think output should be, according to you ?