i have to do this assigment by the next monday...;)

i need to develop a test bank so i have to generate :

1-100 arrays of size 10 with randomly distinct numbers from (0-9)

2-100 arrays of size 50 with randomly distinct numbers from (0-49)

3-100 arrays of size 100 with randomly distinct numbers from (0-99)

4-100 arrays of size 200 with randomly distinct numbers from (0-199)

can u please help in the generation of these arrays..!

i used this code for the generation of the 100 arrays of size 10 but still i have problems in making the numbers distinct and limiting them in the required range for each size..can u help with that please:-| !

#include<iostream.h>

#include<cstdlib>

void main()

{ for(int i=0;i<=100;i++)

{

int a[10];

for (int j=0;j<=10;j++)

{ a[j]=rand()%10;

cout<<a[j];}

}}

Reema_Hamed
0
Newbie Poster

## Recommended Answers

Jump to Postfor your specific problem:

1-100 arrays of size 10 with randomly distinct numbers from (0-9)

2-100 arrays of size 50 with randomly distinct numbers from (0-49)

3-100 arrays of size 100 with randomly distinct numbers from (0-99)

4-100 arrays of size 200 with randomly distinct numbers from (0-199)u could …

## All 16 Replies

Ancient Dragon
5,243

Salem
5,138

vijayan121
1,152

vijayan121
1,152

Salem
commented:
Excellent suggestion, but probably too advanced to hand in as noob homework
+6

thekashyap
193

John A
1,896

WaltP
2,905

Salem
5,138

thekashyap
193

Ancient Dragon
5,243

John A
1,896

thekashyap
193

vijayan121
1,152

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.