Posts by Leandro Campos • 21 points
1 post
-
2
votes3
answers221
viewsA: C++ challenge, helps with logic
The function below returns the expected value: double f(double i, int n) { double result{ 0. }; for (int j = 1; j <= n; j++) { result -= pow(-i, j); } return result; } See that the sign of each…
c++answered Leandro Campos 21