vendredi 15 mai 2020

C++ Can't figure out why its giving false positive (newbie)

Hey so I recently started learning C++ and I can't figure out why this problem is giving a false positive all the time.

Maybe someone can help?

// [Included stuff]

using namespace std;

int main() {

    int erg = 5;
    int inp;

    cout << "Answer: 3 + 2: "; 
    cin >> inp;

    if (inp == erg) {
        cout << "True!";
    };

    if (inp <= erg || inp >= erg) {
        cout << "False!";
    }
    else {

    };
}

Image of the Executed Code

Aucun commentaire:

Enregistrer un commentaire