When I compile this code on my computer, with no special options, I get lots of warnings:
$ cc test.c
test.c: In function ‘main’:
test.c:3:5: warning: implicit declaration of function ‘srand’ [-Wimplicit-function-declaration]
3 | srand(time(0));
| ^~~~~
test.c:3:11: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
3 | srand(time(0));
| ^~~~
test.c:4:18: warning: implicit declaration of function ‘rand’ [-Wimplicit-function-declaration]
4 | int minimo = rand();
| ^~~~
test.c:13:13: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
13 | printf("%d\n", minimo);
| ^~~~~~
test.c:13:13: warning: incompatible implicit declaration of built-in function ‘printf’
test.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+++ |+#include <stdio.h>
1 | int main()
I suspect you saw similar messages and ignored them because you got an executable anyway. It is very dangerous to do that with C. For historical reasons, a whole lot of diagnostics that should be hard errors are only warnings with most C compilers. Therefore, until you have a lot more experience with the language, you should treat all warning messages as if they were hard errors.
Since it sounds like you're using GCC, I recommend you use this set of options until you get more experience:
-g -Og -std=gnu11 -Wall -Wextra -Wpedantic -Wstrict-prototypes -Werror
They turn on a bunch more diagnostics that ought to be hard errors but, again for historical reasons, aren't printed at all by default, and promote all of them to hard errors. Adjust the optimization level (-Ox) as you see fit, and maybe add more warning options (there's a huge list in the manual) but don't take anything out.
(You need to turn on some level of optimization to get all of the diagnostics. Yes, really.)
(I advise against using the hyperconformant -std=c11 mode until you get more experience; it enables things you actively don't want (like trigraphs) and has a nasty tendency to break the system headers.)