So this is a lab where we're supposed to create a random number generator to generate at least 100 integers in an int array. I believe my code may have a few errors in it, but i'm getting 57 errors on my compiler and I just don't see that many. What's wrong with the code below?
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int min, max, lowest = 0, highest = 0;
float average;
int randoms [100];
int main()
{
printf("Enter a minimun value.\n");
scanf("%d",&min);
printf("Enter a maximum value.\n");
scanf("%d",&max);
srand(10);
for(int i = 0; i < 100; i++)
{
randoms[i] = (rand() % ((max-min)+1) + min);
}
output();
lowest();
highest();
average();
}
void output()
{
for(int i = 0; i<101; i++)
{
if(i % 10 == 0)
{
printf(randoms[i]);
printf("\n");
}
else
{
printf(randoms[i]);
}
}
}
int lowest()
{
for(int i = 0; i > 101; i++)
{
if(randoms [i] < min) //finds the lowest value of array
{
min = randoms[i];
}
}
printf("The lowest value is: %d", %min);
return min;
}
int highest()
{
for(int i = 0; i > 100; i++)
{
if(randoms[i] > max)
{
max = randoms[i];
}
}
printf("The highest value is: %d", &max);
return max;
}
float average()
{
int sum = 0;
int count = 0;
for(int i = 0; i > 100; i++)
{
count++;
sum += randoms[i];
}
average = sum/count;
printf("The average value is: %d", &average);
return average;
}