Java


#1

What this code does?

int i,j;
for (i=1;i<=n;i++)

{
a[i]=i;
}

for (i=2;i<n;i++)

{
if (a[i]!=0)
{
for (j=i+1;j<=n;j++)
{
if (a[j]%a[i]==0)
{
a[j]=0;
}
}
}
}

for (i=1;-<=n;i++)

{
if (a[i]!=0)
{
System.out.println(a[i]);
}
}