- 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; }
16 Answers
+ 1
thank you .unfortunately that doesn't help much.
+ 1
thank you very much. tomorrow I will see what the teacher will tell me
+ 1
you can write some comments in the code if the teacher likes you when we explain what we are doing
+ 1
Thx
+ 1
line 15 and line 25 play what role?
+ 1
Thx
0
Where I have X>=lim_nbr I must also do for X<=lim_nbr.
0
but the result I had is good just a small modification in the code.
0
It's urgent
0
where do i put this code?
0
the result in this code must remain the same, despite adding something
0
in the condition X>=lim_nbr I must also make a condition for X<lim_nbr.
0
in fact I do not understand why the teacher asks me this because the result is good
0
I don't know much about C++ I don't know how to use it 😅
0
can you add what is missing for me please?
0
you can make a 2D matrix but in a dynamic way?