I'm having trouble inputing values from the keyboard when I run my code. Everything compiles successfully, but when I go to run my code it prints out like this:
How many numbers would you like to place in the array: 7
Enter number 1: Enter number 2:
etc, etc
Why is this happening? Also, is there a way to count and store the number of times that each element is in the array?
int main(void)
{
int numbers = 0;
int j = 0;
char numStorage[j];
int times = 0;
char newArray[j];
printf("How many numbers would you like to place in the array: ");
scanf("%d", &numbers);
j = numbers;
int i = 1;
while (i < (numbers + 1))
{
printf("Enter number %d: ", i);
scanf("%c", &numStorage[i]);
i++;
}//close of while loop
int x;
for (x = 0; x < numbers; x++)
{
newArray[x] = numStorage[x];
}//close of for loop
int z;
int q;
for (z = 0; z < numbers; z++)
{
for (q = 0; q < numbers; q++)
{
if (numStorage[z] == numStorage[q])
{
times++;
q++;
}//close of if
else
{
q++;
}//close of else
}//close of for loop
printf("\n%d occurs %d times", numStorage[z], times);
z++;
q = 0;
times = 0;
}//close of for loop
}//end of main method