PRINT SERIES PROBLEM ::Multiples are still being printed

#include
#include<bits/stdc++.h>
using namespace std;
int series(int n1, int n2)
{ for(int i=1;i<=n1;i++)
{ if((3i)+2%n2==0)
{
break;
}
else{cout<<(3
i)+2<<endl;}

}

}
int main(){
int n1,n2;
cin>>n1>>n2;
series(n1,n2);
return 0;}

@S19LPPP0159 hey Gautam go through this link I have corrected your code
link.