I'm hoping to find a way to fill an array with random floating point numbers. My array is size 50 and I'm hoping to fill this array with random float numbers from range 1-25. Here is what I have so far. I greatly appreciate any tips or answers anyone can offer. Thank you.
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
float myArray[50];
for(int i = 1; i <= 25; i++)
{
srand(time(0));
myArray[i] = (rand()% 50 + 1);
cout << myArray[i] << endl;
system("Pause");
return 0;
}
}