you should not change else if to if
in your situation it should be
Code:
if (random_integer >= high)
{
// congatz
}
else
{
// random_integer now is less than high
}
the first note is :
Code:
int low = 770;
int high = 777;
Code:
if (random_integer >= low)
ok .
Code:
else if (random_integer >= high)
why?
this statement will never executed because you already check if random_integer>=770
here .
Code:
if (random_integer >= low)
the second note is :
if you are using else if statement the first if statement must be false in order to execute the else if statement.
in your case
Code:
if (random_integer >= low)
is always true
to keep the window open just put
before the return statement
remember to put return statement before the last curly bracket.
.