Computer tries to guess your inputted number I'm rehashing some of the basics of c++ and I just want to find useful points along the way of things I can do to improve my coding.
This program has the user enter a number, then the computer try to guess it, with some higher/lower logic.
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;

int main()
{
    srand(static_cast&lt;unsigned int&gt;(time(0)));  //seed random number generator

    int secretNumber = 0;
    int tries = 0;
    int guess;

    int highRange = 100;
    int lowRange = 0;

    std::cout &lt;&lt; &quot;\tWelcome to Guess My Number\n\n&quot;;

    std::cout &lt;&lt; &quot;\tPlease enter your number between 1 and 100:\n&quot;;

    std::cin &gt;&gt; secretNumber;

    do
    {
        do
            guess = rand() % highRange + 1;
        while (guess &lt;= lowRange);

        ++tries;

        if (guess &gt; secretNumber)
        {
            std::cout &lt;&lt; &quot;Computer guess was too high! (&quot; &lt;&lt; guess &lt;&lt; &quot;)\n\n&quot;;
            highRange = guess;
        }
        else if (guess &lt; secretNumber)
        {
            std::cout &lt;&lt; &quot;Computer guess was too low! (&quot; &lt;&lt; guess &lt;&lt; &quot;)\n\n&quot;;
            lowRange = guess;
        }
        else
        {
            std::cout &lt;&lt; &quot;\nI guessed it! (&quot; &lt;&lt; guess &lt;&lt; &quot;) in &quot; &lt;&lt; tries &lt;&lt; &quot; guesses!\n&quot;;
        }

    } while (guess != secretNumber);

    return 0;
}
You can simplify this:
    do
        guess = rand() % highRange + 1;
    while (guess &lt;= lowRange);

Why not get a value in the correct range then add lowRange.
    // I did not check the maths there
    // may be an off by one error in this
    // Please verify the range is correct.
    guess = rand() % (highRange + 1 - lowRange);
    guess += lowRange;

I am not complain about you using rand() in this extremely simple example code. But you should note that:

rand() is not very random.
rand() % x not all values in the range [0-x) are equally probably.

Please have a look at the C++ standard random number generator (you are using the C version).
http://www.cplusplus.com/reference/random/

You use the correct C++ header files:
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;

This puts all the functionality in the std namespace. Though it allows implementations to also add a definition in the global namespace (though this is optional). But this optional bit is what allows it to compile on your system (but you can't assume it would work everywhere).
So the functions you use should be prefixed with std::.
std::srand(static_cast&lt;unsigned int&gt;(std::time(0)));
^^^^^                                ^^^^^

....
std::rand() % highRange
^^^^^