#include <iostream>
usingnamespace std;
int add_by5(int num);
int main () {
int num = 0;
cout << "Enter the number of times you with to run"<<endl;
cin >> num;
cout << add_by5(num);
return 0;
}
int add_by5(int num){
int sum = 0;
for (int i = 1; i < num ; i++) {
sum += (num*5);
}
return sum;
}
This will add increase the running sum by 5 for 'n' iterations
so say you enter in 3, the sum will = 30
i.e 5+10+15= 30