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
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Salem 5,199 Posting Sage
Reema_Hamed 0 Newbie Poster
Reema_Hamed 0 Newbie Poster
vijayan121 1,152 Posting Virtuoso
vijayan121 1,152 Posting Virtuoso
Salem commented: Excellent suggestion, but probably too advanced to hand in as noob homework +6
thekashyap 193 Practically a Posting Shark
John A 1,896 Vampirical Lurker Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Salem 5,199 Posting Sage
thekashyap 193 Practically a Posting Shark
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
John A 1,896 Vampirical Lurker Team Colleague
thekashyap 193 Practically a Posting Shark
vijayan121 1,152 Posting Virtuoso
Reema_Hamed 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.