Skip to content
Related Articles
Open in App
Not now

Related Articles

std::uniform_int_distribution min() method in C++ with examples

Improve Article
Save Article
  • Last Updated : 17 Jun, 2019
Improve Article
Save Article

The min() method of uniform_int_distribution class in C++ is used to get the minimum possible value that can be generated by this uniform_int_distribution.


result_type min() const;

Parameters: This method do not accepts any parameters.

Return Value: This method return the minimum possibly generated value in this uniform_int_distribution.


// C++ code to demonstrate
// the working of min() function
#include <iostream>
// for uniform_int_distribution function
#include <random>
using namespace std;
int main()
    int a = 10, b = 100;
    // Initializing of uniform_int_distribution class
    uniform_int_distribution<int> distribution(a, b);
    // Using min()
    cout << "Min value that can be generated "
         << "by this uniform_int_distribution: "
         << distribution.min() << endl;
    return 0;


Min value that can be generated by this uniform_int_distribution: 10


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!