# Write a program that enters a natural number N and prints on the screen all natural

July 19, 2021 | education

| **Write a program that enters a natural number N and prints on the screen all natural numbers not exceeding N and divisible by each of their digits.**

We write the program:

program qq;

var i, n, k, f: integer;

begin

writeln (‘Vvedite n:’); readln (n);

for i: = 1 to n do

begin

k: = i; f: = 0;

while (k <> 0) do

begin

if (k mod 10> 0) and (i mod (k mod 10)> 0) then f: = 1;

k: = k div 10;

end;

if (f = 0) and (i mod 10> 0) then write (i, ”);

end;

end.

The program has been written.

One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.