• + 0 comments

    c++

    int squares(int a, int b) { int result = 0;

    for(int i=1; i<=b;i++){
        int square = pow(i, 2);
        if(square<= b and square>=a){
            result++;
        }else if (square > b) {
            break;
        }
    }
    
    return result;
    

    }