There are two simple approaches:
First, you can use a file of numbers:
printf("\nEnter number of elements: ", MAX);
scanf("%d", &num);
FILE *f = fopen("numbers.txt","r");
if (f == NULL){... handle error }
for (i = 0; i < num; i++)
fscanf(f,"%d", &arr[i]);
fclose(f);
This is fine, but you should, of course, test fscanf for errors (see the documentation of fscanf) and at the same time, you can replace num with waiting for feof(f) signaling the end of file.
Still, on most operating systems, there are shell pipes that can actually make a file an input to a program. For your snippet, you could format your file by placing the number of numbers in the first line and then the input to the second round of scanfs (e.g., the space separated numbers) into the second line.
Then, on Linux,
cat filename.txt | yourprogram
will behave as if you were inputting the content of file through the keyboard. For Windows, replace cat with type (as far as I remember...)