Answer:
#include <stdio.h>
int main()
{
int A[10];
int sum = 0;
printf("Enter array elements\\");
for (int i = 0; i < 10 ; i++)
scanf("%d", &A[i]);
for (int i = 0; i < 10 ; i++) {
if (i % 2 ==1)
sum += A[i];
}
printf("Sum of odd indexed elements: %d \\", sum);
printf("Array in reverse order: ");
for (int i = 9; i >= 0; i--)
printf("%d ", A[i]);
return 0;
}
Step-by-step explanation:
Declare the array and sum variable
Ask user for the array elements and put them in the array using for loop
Calculate the sum of the numbers that are at odd index, check if the index is odd using modulo operator
Print the array in reverse order using for loop, start the index from 9 and go until 0, so that it will print from back