Answers for "how to type a random number of 0 and 1 in c++"

C++
2

c++ random number 0 to 1

#include <iostream>
#include <string>
#include <random>

int main() {
    std::mt19937 gen (123);
    std::uniform_real_distribution<double> dis(0.0, 1.0);
    double x = dis(gen);
    std::cout << x << std::endl;
}
Posted by: Guest on May-11-2021

Code answers related to "how to type a random number of 0 and 1 in c++"

Browse Popular Code Answers by Language