Test case did't pass

what is wrong in my code?
#include
using namespace std;

int main()
{
int n1,n2;
cin>>n1;
cin>>n2;
int count=1,n=1;
while(count<=n1){

    int ans=3*n+2;
    if(ans%n2!=0){
        cout<<ans;
        count++;

    }                
    n++;
  }
return 0;

}

You need to use endl in line 15
cout<<ans<<endl;

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.