vector<int> calculateSeries(int lån, int år) {
constexprint rente = 10;
vector<int> innbet(år);
int remLoan = lån;
for (int i = 0; i < år; i++) {
innbet[i] = ((lån/år) + (rente/100)*remLoan);
remLoan -= innbet[i];
}
return innbet;
}
When I run the code from main, I get a vector of 500s as output, i.e. innbet[i] has a constant value of 500. Why? I tried breakpoints in my code and remLoan changes as intended, but clearly innbet doesn't. Anyone?