I am needing to print my array in 5 lines of 10 numbers evenly spaced. this is what I have:
I not exactly sure how to do this.Code:#include <stdio.h> #include <stdlib.h> #include <time.h> int compare (void *a, void *b); void main(void) { int x, y, ia[50]; srand(time(NULL)); for(x=0; x<50; x++) { y=rand()%1000+1; ia[x]=y; printf("%d", ia[x]); qsort(ia, 50, sizeof(int), compare); } } int compare(void *a, void *b) { return *(int*)a-*(int*)b; }



LinkBack URL
About LinkBacks


