Wrong Output (Java Program)
hi guys... this is my program and i dont know what is wrong:S
The problem is in the main i guess..Can you guys help me please? thanks for everything
public class Xiu {
public static void main (String []args)
{
int max = 50;
System.out.print(enigma(max)+ " ");
}
public static boolean[] enigma(int max) {
boolean[] res = new boolean[max+1];
for (int i = 0; i < 2; i++) res[i] = false;
for (int i = 2; i < res.length; i++) res[i] = true;
for (int i = 2; i < res.length; i++)
if (res[i])
for (int j = i; i * j < res.length; j++)
res[i * j] = false;
return res;
}
}