Well looping as I understand it happens. Do not be lazy and take your own data and run with them and next to write down on paper the result will see the reason. the first substitution -2 gives a loop in the case of while
begin write('Введите значение x '); read(x); // -2 y:=-5*x+13; 23 if y>0 then // ок прошли дальше begin write('Введите значение шага преращения '); read(d); end; while y>0 do // до сих пор значение 23 пошли по циклу и зациклились begin x:=x+d; y:=-5*x+13; end; write(y) end.
Is the issue resolved? if not then change the cycle, you don’t need it if the condition
Honestly, the logic of writing your code is completely incomprehensible.
Well, here is the first if you checked, the condition passed, and if not, then what should happen? just go on through the code, this is wrong. well, etc.
What should this small and incomprehensible program do?