Use dynamic allocation. Increase memory allocation with realloc. The complete process is as follows:
# include & ltstdio.h & gt
# include & ltstdlib.h & gt
int main()
{
Int input, n;
int count = 0;
int * numbers = NULL
int * more _ numbers = NULL
Do {
Printf ("Enter integer value (0 to end):");
Scanf ("%d ",& input);
count++;
more _ numbers =(int *)realloc(numbers,count * sizeof(int));
If (more _ numbers! =NULL) {
Numbers = More _ Numbers;
Numbers[count- 1]= input;
}
Otherwise {
Free (digital);
Puts ("memory is (re) allocated incorrectly");
Exit (1);
}
} while (enter! =0);
Printf ("Number entered:");
for(n = 0; N< count; n++) printf ("%d ",numbers[n]);
Free (digital);
Returns 0;
}