Given two arrays A and B. Create an array C, each element of which is the sum of the corresponding
Given two arrays A and B. Create an array C, each element of which is the sum of the corresponding elements of arrays A and B.
program zz1;
const n = 10; // set the number of elements in the array
var i, k: integer; // set variables of integer type
a, b: array [1..n] of integer; c: array [1..n] of integer;
begin
for i: = 1 to n do // write numbers in the array at random
a [i]: = random (101);
for i: = 1 to n do // display the array on the screen
write (a [i], ”);
writeln; // go to a new line to display the response
for i: = 1 to n do // write numbers in the array at random
b [i]: = random (101);
for i: = 1 to n do // display the array on the screen
write (b [i], ”);
writeln; // go to a new line to display the response
for i: = 1 to n do
c [i]: = a [i] + b [i];
for i: = 1 to n do // display the array on the screen
write (c [i], ”);
end.