Can anyone help me understand this code especially in the "if (num1%num2==0)" part. I'm just wondering how come it outputs num2 even though num1%num2 is NOT equal to 0.
(Sample Output)
Type a number: 12
Output: 1 2 3 4 6 12
include <iostream>
using namespace std;
void factors(int num1,int num2){
if(num2==0){
return;
}
else{
factors(num1,num2-1);