/bin/run.sh: line 4: 18 Arithmetic exception (core dumped) ./exe

#include
using namespace std;
int main(){
int num1, num2;
cin >> num1>>num2;
int cnt = 0;
int i = 1;
while(cnt < num1){
int num = (3*i)+2; i++;
if (num%num2==0){}
else{
cout<<num<<endl;
cnt++;
}
}
return 0;
}

I’m getting Arithmetic Exception her, Please help me out.

@er.mdakilahmed this coding is working perfectly and passing all the testcases
dont forget to mark the doubt resolved and hit like if cleared :smiley: