سلام میشه بگید کجای برنامه من مشکل داره؟ من تازه کار با ++C رو شروع کردم ممنون میشم
وظیفه این برنامه تولید مثلا بیست عدد تصادفی بین مغتیرهای L وU هست و کار هم میکنه اما فقط یه عدد میده من میخوام مثلا بیست تا عدد تصادفی بهمون بده که این هم توسط متغییر Count تعیین میشه
ممنون
کد:
#include <iostream.h>
#include <conio.h>
#include <time.h>
#include <stdlib.h>
int rnd(int l,int u,int count)
{int res=0;
for(int c=1;c<=count;c++)
{randomize();
res=l+random(u-l);//generate [count] number between [L] and [U]
return res;
}
}
void main()
{
int L,U,count,res;
cout<<"Please enter Low bound,Upper bound and count:";
cin>>L>>U>>count;
res=rnd(L,U,count);
cout<<res<<endl;
getch();
}
ممنون