In an array of 20 elements filled with integers from the interval [10; 100] find the number of even numbers ending in digit 4. Pascal.
February 22, 2021 | education
| program arr;
var a: array [1..20] of integer;
n: integer; // number of elements ending in digit 4
begin
n: = 0;
writeln (‘Print array’);
for var i: = 1 to 20 do
begin
a [i]: = Random (90) +10; // random number in the range 10..100
if (a [i] mod 10) = 4 then n: = n + 1; // count the number of elements,
// ending in 4
write (a [i], ”); // print array elements
end;
writeln ();
writeln (‘The number of array elements ending in digit 4 -‘, n);
end.
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.