#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
int N,A[8];
cout<<"Enter the number:";
cin>>N;
srand(time(0));
for(int i=1;i<=8;i++)
{
A[i]=rand()%40+10;
for(int j=0;j<1;j++)
{
cout<<A[i];
}
cout<<" ";
}
return 0;
}
basom 0 Newbie Poster
basom 0 Newbie Poster
nullptr 167 Occasional Poster
TrustyTony commented: Good thinking of mathematical consequences of uniqueness: ' not more than the number of integers between 10 and 40 inclusive' +12
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.