EMC Interview Question
Software Engineer in TestsTeam: RSA
Country: India
Interview Type: Written Test
int fun(int N)
{
int array[N] ={0};
int i= 2,j;
while(i<sqrt(N))
{
j =i;
j=j+j;
while(j<N)
{
array[j] = -1;
j = j+i;
}
i++;
}
j=0;
for(i=0;i<N;i++)
if(array[i]==-1)
j++;
return(j);
}
- sqw June 04, 2012