The separate function no longer takes a parameter, so the function prototype updates to:
int numbergen(); //initializes number generator function less than 9
Two lines are added to the beginning of the while loop, and the call to the numbergen function is removed from the printf line.
1 2 3 4 5 6 7
while ( userAnswer != -1 )
{ //start while loop for quiz
number1=numbergen(); // assign random number to number1
number2=numbergen(); // assign random number to number2
printf("\nWhat is %d multiplied by %d?\n",number1, number2);
scanf( "%d", &userAnswer );
answer=number1*number2;
Separate function is just this.
1 2 3 4
int numbergen()
{
return 1+(rand()%9); //generates a random number 1-9
}//end number generator