C++: ++x vs x++ in the Challenge Section of the Sololearn App | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

C++: ++x vs x++ in the Challenge Section of the Sololearn App

Its clear x++ first uses the value x and then increments it by 1 and ++x first increments the value x and then uses it. However, solving several simple tasks in the Challenge Section, I noticed that all my answers to the questions about the increment in C++ were evaluated as wrong. Can it be caused by some internal app error? Consider the following: int main() { int x = 12, y = 6; cout << ++x % --y; return 0; } Expected answer: 3, App Playground says "agreed", App Challenge Section says "no".

3rd Apr 2017, 9:13 AM
blackMZworld
blackMZworld - avatar
1 Answer
+ 9
Some questions in challenges have wrong answers. We should screenshot them and report them to [email protected] so that they will be taken care of.
3rd Apr 2017, 12:17 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar