Number Guessing Game in C++ without global varibles
rand() is bad; don't use it.

Instead, use the &lt;random&gt; library for generating random numbers:

static std::mt19937_64 engine(std::random_device{}());
std::uniform_int_distribution&lt;&gt; dist(1, 100);
std::cout &lt;&lt; dist(engine);


You'll then have:

int makeNum() {
    static std::mt19937_64 engine(std::random_device{}());
    std::uniform_int_distribution&lt;&gt; dist(1, 100);
    return dist(engine);
}

The name calc() doesn't make sense with the expected return and it doesn't even calculate anything. You can rename it to hasWon() and rename the variable to won.

Moreover, I would move the output to main() since it shouldn't really be responsible for printing to the console. Just have it do the comparison and then return the value.
Do you really need the program to sleep? It may not be worth that call, plus it prevents it from being portable to other systems. You can always use std::cin.get() to "pause" the program by asking the user to enter a character before proceeding.