0
How do I correct this?
I started learning C++ a while ago so I'm not that good at it. Recently I created a code which is supposed to answer "wrong" when given a wrong answer but instead it answers "correct" even when I give a wrong answer to the question. What could I possibly do to correct this code? https://code.sololearn.com/cyxp6WGiwi46/?ref=app
2 Respuestas
+ 3
= is assignment operator, therefore: something = 3 is evaluated to be true, because... "something equals 3".
== is equality operator. it's like saying, "is equal to": if (something == 3), "if something is equal to 3", then do this, else do that.
+ 1
You write if(answer = 3) .
It has to be ==.