#include int getSumOfMultiplesWithMaxLimit(int base,int max){ int sum = 0; for (int multiplier = 0, result = 0; result <= max; ++i ) { result = base * multiplier; if(result <= max) sum += result; } return } int main(int argc, char const *argv[]) { int result = getSumOfMultiplesWithMaxLimit(3,1000) + getSumOfMultiplesWithMaxLimit(5,1000) - getSumOfMultiplesWithMaxLimit(15,1000); cout.write("Result: "+result); return 0; }