Похожие чаты

Hi In this code, do-while doesn't work, I expect to see

at least 3 cycle to achieve the root but it shows me only one number which is the final answer, what's the problem?

13 ответов

7 просмотров
Paria.-Z Автор вопроса

https://pastebin.com/EkubSa2h

Paria. Z
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;

Paria. Z
https://pastebin.com/EkubSa2h

Forget about my first comment (that I deleted), I've misread your loop code

Paria.-Z Автор вопроса
Pavel
Another unrelated tip, you have constants, it's be...

Thx But actually the issue is not about the constants It is about the do-while loop

Paria. Z
Thx But actually the issue is not about the consta...

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

Paria.-Z Автор вопроса
Pavel
Yeah, I'm trying to read it right now, but it's ra...

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🤔

Paria.-Z Автор вопроса
Paria. Z
Thx, Yes I'm Using codeblocks but it didn't show a...

Not sure if we're talking about the same thing. From 2:38 https://youtu.be/Jab1qj_QR8s

Paria.-Z Автор вопроса
Pavel
Not sure if we're talking about the same thing. Fr...

Thx, I thought you meant the compiling error😅

Paria. Z
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.

Paria.-Z Автор вопроса
Pavel
It might be not the best video (grabbed the first ...

Actually I didn't get What is the difference between debugging a program and the errors which are showed when we compile it

Paria.-Z Автор вопроса
Paria. Z
Actually I didn't get What is the difference betwe...

Because when I order to compile the program it shows me if there is any syntax error, command error and so on

Paria. Z
Because when I order to compile the program it sho...

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.

Похожие вопросы

Обсуждают сегодня

Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
32
А чем вам питонисты не угодили?😂
.
79
Hey guys, did you see the new announcement about $Fun? 🔥
Filip Murphy
55
Язык Си можно выучить за день? По книжке ANSI C на 230 страниц
Vincent Vegan
29
Привет, запускаю werf в dind в k8s, получаю ошибку на этапе build/beforeSetup: /.werf/stapel/embedded/bin/bash: /.werf/scripts/5898bdfe5214357d3706b879cc8d3d78460fb379607cbd...
florius0
7
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
пацаны, как-нибудь можно панель задач заблюрить, что она была похожа на kde или винду 7, 11?
В
16
or do they all have 240?
Ilnur Zaripov
9
HI. Just reviewd Planck website which looks undercooked and some menu is not leading to correct section of site. Also, the vesting is shown to be for 20 months starting next y...
Neo517
4
Дорогие любители Прекрасной Джулии! Есть кто-то имеющий практический опыт построения ML для Систем Управления? Нам нужно сделать нейросеть для автоматической подстройки пара...
Roman Timo
4
Карта сайта