I just tried it using gcc via rextester, and your code shows no such error:
Compilation time: 0.12 sec, absolute service time: 0,29 sec
Error(s):
1693378824/source.c: In function ‘main’:
1693378824/source.c:12:1: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &test);
^~~~~~~~~~~~~~~~~~
1693378824/source.c:19:6: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
^~~~~~~~~~~~~~~
/tmp/ccqMGKKo.o: In function `main':
source.c:(.text.startup+0xff): undefined reference to `fmod'
collect2: error: ld returned 1 exit status
The reference error is probably due to a lack of library for the linker phase, but there are no compilation errors - just warnings you should fix.
Check you are compiling and editing the same file ...