Doubt in the code of "Print series "

Sir the output of my code come half .Please tell me on where i make mistake .
#include
using namespace std;
int main() {
int n1,n2;
int n=1;

cin>>n1>>n2;
while(n<=n1)
{
    int k=3*n+2;
    if (k%n2!=0)
    {
        cout <<k<<endl;
    }
    n++;
}
return 0;

}

@76rahul257 hey rahul do one thing create a else block after
if {
//statement of your code
}
else{
n1++;
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.