Please can somebody help me? I made a program that creates an array of 100 random numbers... I know the maximum and the minimum, but I need to know how many times maximum (minimum) is repeated in the array. I have tried everything, nothing has worked. This is my "program" :
Thank You very much for your help!Code:#include<stdio.h> #include<conio.h> main() { int i,c; int array[99]; int min=array[0], max=array[0]; srand (time(NULL)); for (i=0; i<=99;i++) { array[i]=rand()%1000; printf("array[%d] is %d\n",i,array[i]); if(array[i]>max) max=array[i]; if(array[i]<min) min=array[i]; } printf("\n\nMaximum is %d\n",max); printf("Minimum is %d\n",min); system("pause"); }
S.



LinkBack URL
About LinkBacks



