Solutions/p6/main.cpp
// Find the square of the sum up to k > 0.
Find the square of the sum up to k > 0.
Find the square of the sum up to k > 0 .
int squareOfSum(int k) {
    auto sum = 0;
    for (int i = 1; i <= k; ++i) {
        sum += i;
    }
    return pow(sum, 2);
}
int squareOfSum ( int k ) { auto sum = 0 ; for ( int i = 1 ; i <= k ; ++ i ) { sum += i ; } return pow ( sum , 2 ) ; }
Find the square of the sum up to k > 0.
Find the square of the sum up to k > 0 .