> cin >> number;
Why would you use an array under such circunstances? Considering the input is supposed to be solely 1 number, you'd be better off doing it this way:
>if(number == 1)
I don't understand this piece of code. The program is supposed to close if the user inserts a number other than 1?
Your loop itself is kinda messy. You'd be better off doing something like this:
//why from 0 to 9(Or from 1 to 10)? i equals to the number of tries and should beggin with the 1st try, which is i=1 or i = 0 + 1
for (int i = 0; i < 10; i++)
//Logicly the number of attempts goes from the lowest to the highest, ain't that right?
//eg. 1st attempt, then 2nd attempt, etc etc.
std::cout << "This is your 1st attempt\n";
std::cout << "This is your 2nd attempt\n";
std::cout << "This is your 3rd attempt\n";
std::cout << "This is your " << i + 1 <<"th attempt\n";
//Here you get to input a number everytime the loop goes
std::cout << "Enter a number: ";
std::cin >> number;
//The following if conditions check whether the 10 attempts have been reached or if the user inserted the correct number (2)
if (number == 2)
if (i == 9)