Write a function which prints first N1 terms of the series 3n + 2 which are not multiples of N2

import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int N1=sc.nextInt();
int N2=sc.nextInt();
for(int i=1;i<=N1;i++)
{
int temp=3*i+2;
if(temp%N2==0)
continue;
else
System.out.println(temp);
}
}
}

sir i have written this code but it doesnt pass all test cases sir what is wrong in my code and sir how i increase my thinking capability so that i can code easily

Hi @anshul456agrawal_bbefdea734d799ec

One of mistake in your code is that you are not writing the condition for base case i.e given in question 0 < N1 < 100 0 < N2 < 100 N1 and N2 values must lie between these . I am Attaching an update code here please check it and if you still face any issue please let me know.