Вопрос задан 31.07.2023 в 15:24. Предмет Информатика. Спрашивает Степанов Артём.

Uses crt; var a:integer; begin for a:=10000 to 99999 do if (a mod 133=125) and (a mod 134=111)

then writeln(a); end. Из этой программы сделать программу с циклом while
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Кубик Дима.
Uses crt;
var a:integer;
begin
a:=10000;
while(a <= 99999)do
begin
if (a mod 133=125) and (a mod 134=111) then writeln(a);
a:=a+1;
end;
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

To convert the given program to a program with a while loop, we need to initialize the variable a to 10000 before the while loop and then increment it within the loop until the desired condition is met. Here's the modified program using a while loop:

pascal
Uses crt; var a: integer; begin a := 10000; while a <= 99999 do begin if (a mod 133 = 125) and (a mod 134 = 111) then writeln(a); Inc(a); end; end.

In this version of the program, the a variable is initialized to 10000 before the while loop. The loop continues as long as the value of a is less than or equal to 99999. Inside the loop, we check if the conditions (a mod 133 = 125) and (a mod 134 = 111) are satisfied, and if so, we print the value of a. Then, we increment the value of a using Inc(a) so that we can test the next value in the next iteration. The loop will keep executing until the value of a goes beyond 99999, at which point the program will terminate.

0 0

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

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос