Given an array of integers consisting of 10 elements, output the indices of those elements whose value is greater
Given an array of integers consisting of 10 elements, output the indices of those elements whose value is greater than a given number A (A is entered from the keyboard) Programming language: Pascal.
program zz1;
const n = 10; // set the number of elements in the array
var i, a: integer; // set variables of integer type
m: array [1..n] of integer;
begin
write (‘enter the given number’);
read (a);
for i: = 1 to n do // get n random numbers and write them into an array
m [i]: = random (21);
for i: = 1 to n do // display the resulting array on the screen
write (m [i], ”);
writeln; // go to a new line to display the response
for i: = 1 to n do
if m [i]> a // check if the next element of the array is greater than the specified number, then
then write (”, i); // display the answer
end.