Originally Posted by
whiteflags
He has more to do with the number than just print it, like store and sort it, so if anything this wastes time.
Amusingly, I think the earlier assignment was the harder one. For this one, you can just print each element of the array after sorting.
mmm run that
Code:
int main(void)
{
int randNum = 0;
int myArray[100];
int i;
srand((int)time(0)); // Seeds Random Numbers
for(i=101; i > 0; i--)
{
// randNum = rand()%20 + 1;
printf("%d\n", (myArray[i] = rand() % 20) );
randNum++;
printf("n %d\n", randNum);
// myArray[i] = randNum;
}
printf("\n hey\n");
for (i = 0; i < 100; i++) // see if it has values in the array :)
printf("%d\n", myArray[i]);
return 0;
}
fix the numbers in the ( ) I was playing with it earlier
I already completed this assignment in that link, if he needs to go the other way in sorting he just needs to reverse the bubble sort.
looks like he has trained some of us? just do a minimal amount of code then toss it us to chew on. just saying.
makes me wonder what his next semester will be like, how much will he really know when it comes time to apply the basics to greater things ahead?