// HigherLower.cpp : Defines the entry point for the console application. // #include #include using namespace std; int main() { //Declate integers srand((unsigned)time(0)); int randnum =(rand()%10)+1; int guess; char user[50]; //Ask for users name cout << "Hello, I don't know your name, who are you ?" << endl; cin >> user; cout << "Oh, Hi " << user << " let's start!" << endl; //Start main game cout << "I'm thinking of a number from 1 to 10, guess it, and you win!" << endl; cin >> guess; //Was the answer correct? if (guess == randnum) { cout << "Well done!" << endl; cout << "You chose " << guess << " " << randnum << " and it was correct" << endl; return system("pause"); //return 0; } else { cout << "Sorry!" << endl; cout << "You chose " << guess << " but the actually number was " << randnum << endl; return system("pause"); //return 0; } }