#include
using namespace std;
int main()
{
int n;
cin>>n;
int b;
cin>>b;
int r;
for(int i=1;i<=n+3;i++)
{
r= (3*i+2);
if(r%b!=0)
cout<<r<<endl;
}
}
#include
using namespace std;
int main()
{
int n;
cin>>n;
int b;
cin>>b;
int r;
for(int i=1;i<=n+3;i++)
{
r= (3*i+2);
if(r%b!=0)
cout<<r<<endl;
}
}
@rakesh800650 you need to use a different variable as loop control variable and another variable to control the series. I made the necessary changes to your code. Please take a look https://ide.codingblocks.com/s/187381
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.