Hi,
I want to display integers 0-99 in randomize order. I can get the list on integers, but can not do in randomize order, I used rand and srand, but it’s not giving me unique numbers. Can anyone help me? -thanks
Here is what I did so far…
//* This is to get the 0-99 integers….*//
#include <iostream>
using std::cout;
using std::endl;
#include <iomanip>
int main()
{
int n[ 99 ];
for ( int i = 0; i < 99; i++ )
n[ i ] = 0;
cout << "Integer" << endl;
for ( int j = 0; j < 99; j++ )
cout << j << endl;
return 0;
}
//* Randomizing numbers…*//
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for (i = 0; i < 10; i++) {
printf("%d\n",rand()%10);
}
return 0;