#include <iostream>
      using namespace std;
      
      int rndInt(){
        srand(1); //set random seed for reproducible result
        // this will generate numbers from 3 to 3+5=8
        for(int i = 0; i < 10; i++){
          cout << rand()%5+3 << " ";
        }
        return 0;
      }
      
      Cpp language logo

      Random integer

      Codiga's C++ Recipes

      Generate a random integer

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.