FIFO queue for a 2D array in ANSI C
We're missing an include of &lt;stdint.h&gt;.  On the other hand, we include  &lt;time.h&gt; which we're not using.
The code doesn't compile here because of the use of Annex K scanf_s() without checking for its availability.  There's no reason not to use ordinary scanf() here (but do examine its return value - that's important!)
There are a lot of magic constants sprinkled throughout the code, with no indication whether they relate to each other.  That makes this an unmaintainable program, because you can't change any of those individually without understanding the whole program.
Also, with all the functionality thrown together in main(), that makes it harder to understand the purpose of each part of the code.  Please divide the code into well-named functions (probably with static linkage).
I recommend fixing those before posting another review request to look at this in any depth.