This one should works
double sum(double n) {
double formula = 0;
for(int i=1; i<=n; i++)
formula += double(i)/double((i+1));
return formula;
}
9
solved Calculating sum formula in c++ [closed]
This one should works
double sum(double n) {
double formula = 0;
for(int i=1; i<=n; i++)
formula += double(i)/double((i+1));
return formula;
}
9
solved Calculating sum formula in c++ [closed]