You should write for every needed output a function which deliver it and than do the output.
You can define an array like this, but you also need to free the memory:
int *arr = 0;
int count = fillArrayFunc( arr, a, b, n );
for( int i = 0; i <count; i++ ) {
int number = arr[i]; printf("The number is: %d", number);
}
free( arr );
int count fillArrayFunc( int *arr, int n, int a, int b)
{
arr = malloc( sizeof(int) * count );
return count;}
You missed to ask earlier, so you have
NOW the problem.