Fair enough. Here is how I might format your program:
Code:
#include <stdio.h>
#define MIN 1
#define MAX 99
int main() {
int polje[10], znamenke[10] = {0};
int i, pom, max = 0;
srand(time(0));
for (i = 0; i < 10; i++)
polje[i] = MIN + rand() % (MAX - MIN + 1);
for (i = 0; i < 10; i++)
printf("%d ", polje[i]);
for (i = 0; i < 10; i++) {
while (polje[i] > 0) {
pom = polje[i] % 10;
znamenke[pom]++;
polje[i] /= 10;
}
}
for (i = 0; i < 10; i++)
if (znamenke[i] > max)
max = i;
printf("\n%d\n", max);
for (i = 0; i < 10; i++)
printf("%d ", znamenke[i]);
return 0;
}
This is what my compiler reported:
Code:
test.c: In function `main':
test.c:10: warning: implicit declaration of function `srand'
test.c:10: warning: implicit declaration of function `time'
test.c:13: warning: implicit declaration of function `rand'
That is, you forgot to #include <stdlib.h> and <time.h>
EDIT:
Looking more carefully at your code, I think that you may have a fundamental misunderstanding about your requirements. You say that you are supposed to find which digit in the array appears the most often. Does this mean the array is supposed to be an array of digits?