Print series problem

i is not printing anything on the output screen

#include
using namespace std;
int main() {
int a,b,c=1,d;
cin>>a;
cin>>b;
cout<<a<<b;
while (1==1){
d=(3*c)+2;
if((d%b)==0){
c++;
if(c==a){
a++;
break;
}
}
else{
cout<<d;
c++;
}
}
return 0;
}

There were a minor glitches in your code and in your logic. I have made a few changes to your code. Here’s the modified code :


Hope that helps.