printseries(I am not getting how to increase number..like for the sample input itself..it is printing seven times)?

#include
using namespace std;

int main() {
int N1,N2;
cin>>N1;
cin>>N2;

int n,c;
for(n = 1; n<=N1  ; n++){

c = 3*n+2;
    if(c%N2 != 0){

        cout<<c<<endl;
    }
    else{
    
    }
}

return 0;

}

hi @abhinavssr2003_eab0717682969e5c
refer this–>

okay i got my mistake…i should take two variables…thank you sir

1 Like

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.

sir could you please solve this with for loops

Ok… will send you