Guess the Number In C++ Mind that this is my first actual program in C++ and I tried to prepare for any possible input.  Also the reason I included static_cast&lt;void&gt;(generator(range)) is to throw away the first random value because I read on LearnCpp.com that throwing away the first is a common practice to produce more random results.  Anyways here is the code, all suggestions are welcome.
#include &lt;iostream&gt;
#include &lt;limits&gt;
#include &lt;random&gt;

bool validateInput(int input)
{
    using namespace std;

    if (1 &lt;= input &amp;&amp; input &lt;= 100)
        return true;
    else if (!input)
        return false;
    else
        return false;
}

int generateRandomNumber()
{
    std::random_device dev;
    std::mt19937_64 range(dev());
    std::uniform_int_distribution&lt;std::mt19937_64::result_type&gt; generator(1, 100);
    static_cast&lt;void&gt;(generator(range));
    return static_cast&lt;int&gt;(generator(range));
}

bool placement(int input, int target)
{
    using namespace std;
    if (input &gt; target)
    {
        cout &lt;&lt; &quot;Guess is too high.&quot;;
        return false;
    }

    else if (input &lt; target)
    {
        cout &lt;&lt; &quot;Guess is too low.&quot;;
        return false;
    }
    else
    {
        cout &lt;&lt; &quot;Guess is correct!&quot;;
        return true;
    }
}

int main()
{
    using namespace std;
    cout &lt;&lt; &quot;You have 7 guesses to guess what number I am thinking of between 1 and 100.\n&quot;;
    int winning_num{ generateRandomNumber() };
    static int tries{ 1 };
    do
    {
        int num;
        cout &lt;&lt; &quot;\nGuess#&quot; &lt;&lt; tries &lt;&lt; &quot;: Enter a number -&gt; &quot;;
        cin &gt;&gt; num;
        if (!cin)
        {
            cin.clear();
            cin.ignore(numeric_limits&lt;streamsize&gt;::max(), '\n');
            continue;
        }

        cin.ignore(numeric_limits&lt;streamsize&gt;::max(), '\n');
        
        if (validateInput(num))
            ;
        else
        {
            continue;
        }
        if (!placement(num, winning_num))
        {
            cout &lt;&lt; &quot;\nIncorrect!\n&quot;;
            ++tries;
        }
        else
        {
            cout &lt;&lt; &quot;\nCorrect!\n&quot;;
            exit(0);
        }

    }
    while (tries &lt;= 7);
    cout &lt;&lt; &quot;\nYou did not guess the number in the alloted amount of guesses :(\nTry Again!\n&quot;;


}
I like that your code (read functions) follows Single Responsibility Principle.
And also that you've put the number comparison code in a separate function unlike

User guesses the number generated by computer
Computer tries to guess your inputted number

And also that you use static_cast. All are good coding practices!

I'd prefer if you do the text printing in the placement function itself and call it something like compare_with_guess. That way, you don't have to return values and use another if-else block in the caller. Also, the output messages can also be controlled all at one place.
Another way is to use struct like:
struct InputNum{
private:
    const int input;
public:
    InputNum(const int num):input(num){};

    int get() const{
        return input;
    }
    bool greater_than(const int target) const {
        return input &gt; target;
    }
    bool less_than(const int target) const {
        return input &lt; target;
    }
    bool equals(const int target) const {
        return input == target;
    }
}


Use const whenever possible.
const int winning_num{ generateRandomNumber() };// +1 for {} initialiser syntax. 

void compare_with_guess(const int input, const int guess){ // After making the changes I suggested above.

bool validateInput(const int input){



Avoid  using namespace std; completely, let alone using it multiple times in the code.
https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice