When I say cast I mean
for(.. (int) sqrt(i)...)
Moreover, the for shouldn't have as condition the <=, rather the < ? Yes, it should :)
Also, after this and the thing that Matticus said,...
Type: Posts; User: std10093
When I say cast I mean
for(.. (int) sqrt(i)...)
Moreover, the for shouldn't have as condition the <=, rather the < ? Yes, it should :)
Also, after this and the thing that Matticus said,...
You have the printfs inside a loop.
Also, you have to take into consideration precision, since n is an int and sqrt returns a double. Maybe a cast can provide a "fix"