hi, i'm trying to make a code that you enter a number, and then you enter any number except that number or you lose.

i know this is completely wrong, but i have no idea how to make it that if you put the same number twice you lose. Any help would be appreciated.

#include <iostream> #include <cmath> using namespace std; int main() { int wrongNumber; int tries; int number; cout << "Please enter any number" << endl; while (tries<=100){ cin >> number; tries++; if (number == wrongNumber){ cout << "Nice Job. You lost." << endl;} number == wrongNumber; cout << "Please enter any number except " << number << endl; } number = wrongNumber; }

This post has been edited by **kianyt**: 03 February 2018 - 10:13 PM