
Составить программу выводящую на экран честные числа от 8 до 40 быстрее пожалуйста для паскаль
абц

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

я в паскале не очень понимаю, но думаю, как в питоне тебе нужно использовать циклы



Program to Display Honest Numbers from 8 to 40 in Pascal
To write a program in Pascal that displays honest numbers from 8 to 40, you can use a loop to iterate through the numbers and check if each number is honest. Here's an example program:
```pascal program HonestNumbers;
var num: integer;
function IsHonest(n: integer): boolean; var i: integer; begin IsHonest := true; for i := 2 to n - 1 do begin if (n mod i = 0) then begin IsHonest := false; break; end; end; end;
begin for num := 8 to 40 do begin if IsHonest(num) then writeln(num); end; end. ```
In this program, we define a function `IsHonest` that checks if a number is honest. A number is considered honest if it is not divisible by any number other than 1 and itself. We then use a loop to iterate through the numbers from 8 to 40 and print the honest numbers using the `writeln` statement.
Please note that this program assumes you are using a Pascal compiler that supports the `writeln` statement for output. The exact syntax may vary depending on the Pascal compiler you are using.
I hope this helps! Let me know if you have any further questions.


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