Also, if you want the user to enter one 4-digit number you don't have to put each digit in an array, unless you need each digit for something else. If you just want one integer, this is a quick way of doing it (without error checking)
int num = 0;
for(i=0;i<4;i++)
{
a=getch();
printf("*");
num = (num * 10) + a - '0';
}