• + 8 comments

    why not

    for (int i=f;i<=l;i+=f)
    

    instead of

    for(int i = f, j =2; i<=l; i=f*j,j++)
    

    ? Otherwise a very nice solution :)