question is
Take the following as input.
A number (N1)
A number (N2)
Write a function which prints first N1 terms of the series 3n + 2 which are not multiples of N2.
my code-
#include
using namespace std;
int main() {
int n1,n2;
cin>>n1>>n2;
int a;
for(int i=0;i<n1;)
{a=((3*i)+2);
if(a%n2!=0)
cout<<a;
else
i++;
}
return 0;
}
cn someone tll me error in it