Where i am going wrong in this

#include
using namespace std;
int main() {
int i;
cin>>i;
int n;
cin>>n;
int a=0;
while(a<i){
int sum=0;
sum=3*a+2;

// if(sum%n==0)
// {
// break;
// }
// cout<<sum;
// cout<<endl;
if(sum%n!=0)
{
cout<<sum<<endl;
}
else{

}
a++;
}

return 0;

}

hi @itsmazhar7, check your updated code https://ide.codingblocks.com/s/657460 here

yeah got it thanks for updating my code…i am happy that my logic was some what right

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