My issue
my output is correct why in your test case showing differently check out
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
while(t-->0)
{
int no=sc.nextInt();
for(int i=2;i<=no;i++)
{
if(no%i==0){
System.out.println(i);
break;
}
}
}
}
}
Learning course: 2000 to 2500 difficulty problems
Problem Link: Maximum Factors Problem Practice Problem in 2000 to 2500 difficulty problems