Am not able to solve this problem of 3n+2

#include
int main() {
int i;
cin>>i;
int n;
cin>>n;
int a=0;
while(a<i){
int sum=0;
sum=3*a+2;
a++;
if(sum%n==0)
{
break;
}
cout<<sum;
}

return 0;

}

hi @itsmazhar7 ,
please refer this ive commented https://ide.codingblocks.com/s/657459

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.

1 Like