I am trying to create a sequence of 4
different numbers and randomly generated from 0
to 100
but it must have number 86
, here is what I did:
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
srand((unsigned) time(NULL));
// Loop to get 3 random numbers
for(int i = 0; i < 3; i++)
{
int random = rand() % 101;
// Print the random number
cout << random << endl;
}
cout << 86 << endl;
}
But I don't want to put 86
at the end, are there any ways to place it at any random position in the sequence ? Thank you