number of cores c++

#include <iostream>
#include <thread>

int main() {
    // Get the number of available processor cores
    unsigned int num_cores = std::thread::hardware_concurrency();

    // Display the number of cores
    std::cout << "Number of processor cores: " << num_cores << std::endl;

    return 0;
}