About a line of code in problem

what is meant by EOF? It is written after scanning n i.e. the no. of mixtures

EOF is end of file
when input is completed loop will also completed

C++ provides a special function, eof( ), that returns nonzero (meaning TRUE) when there are no more data to be read from an input file stream, and zero (meaning FALSE) otherwise.

Pls can you explain me that statement where inside while condn we are scanning input n and thn checking whether it is != EOF.

here
we are scanning n first
if n exist then it take input and store inside n
but if there is no data then scanf("%d",&n) return EOF
and while loop entry condition fails and it come out of loop