at least 3 cycle to achieve the root but it shows me only one number which is the final answer, what's the problem?
https://pastebin.com/EkubSa2h
Another unrelated tip, you have constants, it's better to initialize them as you declare them, and mark as const. Like const double k1 = 30.0;
Forget about my first comment (that I deleted), I've misread your loop code
Thx But actually the issue is not about the constants It is about the do-while loop
Yeah, I'm trying to read it right now, but it's rather complex to decouple it's logic. Have you tried to use a debugger to execute it step-by-step? If I were you that what I would do in the first place
Thx, Yes I'm Using codeblocks but it didn't show any error The result is correct without Using the loop🤔 I mean it sounds that the loop is not used for calculating the root🤔
Not sure if we're talking about the same thing. From 2:38 https://youtu.be/Jab1qj_QR8s
Thx, I thought you meant the compiling error😅
It might be not the best video (grabbed the first from google), but the debugger tool itself is very useful, so I suggest to try it to understand what happening with your code.
Actually I didn't get What is the difference between debugging a program and the errors which are showed when we compile it
Because when I order to compile the program it shows me if there is any syntax error, command error and so on
Yes, and debugging is for other purposes. It is for investigating your compiled program (that already doesn't contain these syntax errors and compiled to machine code) to see its state during some steps of execution.
Обсуждают сегодня