C++ help | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
- 3

C++ help

Hello how can you please help me with this code .the code works but the teacher told me to make some Modifications too #include <iostream> #include <cmath> #include <math.h> using namespace std; int main() { double x = 1; double som = 0; double lim_nbr = pow(10.0, -6); int n = 1; do{ x = n / pow((4 * pow(n, 2)- 1 ),2); som += x; n+=1; }while (x >= lim_nbr); double correctSum = 1/8.0 ; cout << "Sum = " << som << endl; cout << "Sumcorrect = " << correctSum << endl; return 0; }

5th Jun 2022, 10:30 AM
Daniel Alexis
16 Respuestas
+ 1
thank you .unfortunately that doesn't help much.
5th Jun 2022, 11:44 AM
Daniel Alexis
+ 1
thank you very much. tomorrow I will see what the teacher will tell me
5th Jun 2022, 2:12 PM
Daniel Alexis
+ 1
you can write some comments in the code if the teacher likes you when we explain what we are doing
5th Jun 2022, 2:13 PM
Daniel Alexis
+ 1
Thx
5th Jun 2022, 3:51 PM
Daniel Alexis
+ 1
line 15 and line 25 play what role?
5th Jun 2022, 3:54 PM
Daniel Alexis
+ 1
Thx
5th Jun 2022, 4:10 PM
Daniel Alexis
0
Where I have X>=lim_nbr I must also do for X<=lim_nbr.
5th Jun 2022, 10:36 AM
Daniel Alexis
0
but the result I had is good just a small modification in the code.
5th Jun 2022, 10:37 AM
Daniel Alexis
0
It's urgent
5th Jun 2022, 11:02 AM
Daniel Alexis
0
where do i put this code?
5th Jun 2022, 11:23 AM
Daniel Alexis
0
the result in this code must remain the same, despite adding something
5th Jun 2022, 11:25 AM
Daniel Alexis
0
in the condition X>=lim_nbr I must also make a condition for X<lim_nbr.
5th Jun 2022, 12:16 PM
Daniel Alexis
0
in fact I do not understand why the teacher asks me this because the result is good
5th Jun 2022, 12:17 PM
Daniel Alexis
0
I don't know much about C++ I don't know how to use it 😅
5th Jun 2022, 12:41 PM
Daniel Alexis
0
can you add what is missing for me please?
5th Jun 2022, 12:42 PM
Daniel Alexis
0
you can make a 2D matrix but in a dynamic way?
5th Jun 2022, 4:35 PM
Daniel Alexis