
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

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

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.



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:
pascalUses 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.


Похожие вопросы
Топ вопросов за вчера в категории Информатика
Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili