What is the problem with this program

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();
            int count = 0;
            if(n1<=100){
            for (int i = 1; count < n1; i++) {
                int ap = 3 * i + 2;
                if (ap % 4 != 0) {
                    System.out.println(ap);
                    count++;
                }

            }

          }
            
            else if(n1>100){
                System.out.println();}
            else if(n2>100){
                System.out.println();}
}
        }

hey @himanshusingh2389_63aac7fac0c69386 The problem here is that In your code when you try to check ap%4 it should be ap%n2 because you have to check if it is divisible by n2 and n2 can vary According to input given.

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.