Consider the following program written in a toy programming language. (The meaning of the various commands in this language should be obvious, but if you're confused, click here for the language description).
array A = 1, 2, 7, -4, 6, 2, -1, 4, 6
read N
set I = 0
set J = 0
while I < N
if A[I] % 2 == 0
set J = A[I]
endif
set I = I + 1
endwhile
write J
The first line of the program declares and initializes an array with 9 elements as shown. The second line of the program reads an integer from the input and stores it in N. The rest of the program does some computation, and the last line of the program prints the value of the variable J to the output.
What number should be provided as input to this program, to make it print -4 as the output.
Answers
Answered by
0
Answer:
ok but actually this is hars questions
Similar questions
Math,
29 days ago
English,
29 days ago
CBSE BOARD XII,
29 days ago
Math,
1 month ago
Chemistry,
10 months ago