As I see, you decrease num2 in the while loop. So if you want to reuse it, you have to not change it -- create a temporary variable that will store the value. 2 ways to do:
1) If you want to maintain your while loop:
//add temp variable
int temp = num2;
while(temp){
product += num1;
temp--;
}
//if you want to save num1 as well
temp = num1;
while(temp >= num2){
temp = temp - num2;
quotient++;
}
2)I would suggest using for loops, since they allocate the variable on enter and deallocate on exit, thus less memory usage. Also more convenient:
//variable creation; boolean statement; changer
//our product
for(int temp = num2; temp; temp--){
product += num1;
}
//our quotient
for(int temp = num1; temp>= num2; temp-=num2){// temp -= <var> is equivalent to temp = temp - <var>
quotient++;
}