I have a problem. I have a program that defines an int a[20] so that I can put 20 different values into the array. I am writing a program that will ask the user to input integers and it can be anywhere from 1 - 20 integers. I can read in the values and print them but since my loop says this:
printf("Enter random integers (max 20): "); (example) 2 3 4 2 42
int i = 0;
while (i < 19)
{
scanf("%d", a[i]);
printf("%d ", a[i]);
i++;
}
I get stuck in the never ending loop since the value may never reach nineteen. I do not know what to do because this will output the values but now I am stuck. All I need to do is just get the values from the one line of output to be written in the array at those memory locations and get out of the loop so I can finish the rest of my program.
HELp!!!