#include<stdio.h>
int
main() {
int
a[20], b[20], c[30], i, n;
printf
(
"Enter the number of elements to the array:\n"
);
scanf
(
"%d"
, &n);
printf
(
"\nEnter the %d elements to the array A:\n"
, n);
for
(i = 0; i < n; i++) {
scanf
(
"%d"
, &a[i]);
}
printf
(
"\nEnter the %d elements to the array B:\n"
, n);
for
(i = 0; i < n; i++) {
scanf
(
"%d"
, &b[i]);
}
for
(i = 0; i < n; i++) {
c[i] = a[i] + b[n - 1 - i];
}
printf
(
"\nC array elements are:\n"
);
for
(i = 0; i < n; i++) {
printf
(
"\n"
);
printf
(
"%d"
, c[i]);
}
return
0;
}
Post a Comment