You cannot declare arrays like that.
Yes, but only because the OP is clearly not compiling as C99. I can tell because main() uses implicit int, which was removed in C99.
Here either 'n' should be initialized prior to declaring array
printf("Enter size:");
scanf("%d",&n);
int a[n];
Um, no. Since this is C90[1], array sizes must be a compile time constant. If the above code compiles, it's due to a compiler extension. The C99 standard added variable length arrays (VLAs for googlers), but I strongly discourage their use in robust code. If you want an array sized at runtime, C99 best practice and C90's only portable practice is dynamic allocation:
int *a;
int n;
scanf("%d", &n);
a = malloc(n * sizeof *a);
...
free(a);
On a side note, C90 doesn't allow the mixing of declarations and code. C99 does, but we've already established that this code isn't C99. C++ allows it as well, which suggests that you're compiling as the wrong language (on top of relying on compiler extensions). The problem is that C++ and C are subtly different. If you don't know where the differences lie, you could end up with difficult to trace bugs.
or n should be replaced by some constant value.
That's better, but only if the size is fixed and unlikely to change. Beginners and poor programmers often subscribe to the theory of "640K ought to be enough for anybody", where if you allocate a large enough array to handle all expected input, the code is simpler. However, if/when they grow up and start writing robust code, constant sized arrays tend to be used less, or as intermediates in producing a variable sized "array". An example of the latter case is using fgets()--which requires a fixed buffer--as part of an algorithm to read arbitrarily long strings.
[1] Or C89, or C95. C89 was the ANSI standard before ISO got a hold of it, and C90 is virtually identical to C89 (but it's the "official" international standard). The two are interchangeable. However, when someone talks about C89 or C90, they nearly always mean C94/95, which is C90 + Normative Addendum 1 ("C95" is more commonly used than "C94", but the value of the __STDC_VERSION__ macro says 1994). Normative Addendum 1 basically made C more international-friendly through language and library additions targeting character sets.