srand() c++

#include <iostream>
#include <cstdlib> // Required for srand() function
#include <ctime>   // Required for time() function

int main() {
    // Seed the random number generator with the current time
    std::srand(static_cast<unsigned int>(std::time(nullptr)));

    // Generate a random number between 0 and RAND_MAX using rand()
    int randomNumber = std::rand();

    // Display the generated random number
    std::cout << "Random Number: " << randomNumber << std::endl;

    return 0;
}