#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;
}
#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;
}
okay i got my mistake…i should take two variables…thank you sir
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