malloc(n)-Reserves a block of memory of specified(n) number of bytes.
After the definition we're well equipped to answer that question.Your requirement is to create an array which stores n integers(or equivalently, n integer sized blocks) and not a memory block of n bytes,i hope you're getting the difference. Now, to achieve this,intuitively if we multiply size of an integer with number of bytes(n*sizeof(int)),we should be getting required number of memory blocks(n blocks each of 4 or 2 bytes(size of integer might vary with different compilers :) ).Equivalent syntax is as below:
int *a=(int*)malloc(sizeof(int)*n);