#include <stdio.h>
#define S 40
int main() {
    int a[S],i,n,mid,temp;
    printf("\nEnter how many nos you want in array:");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    printf("\n You have entered :\n");
    for(i=0;i<n;i++)
    {
        printf("%6d",a[i]);
    }
    mid=n/2;
    for(i=0;i<mid;i++)
    {
        temp=a[i];
        a[i]=a[n-1-i];
        a[n-1-i]=temp;
    }
    printf("\n REveresed array:\n");
    for(i=0;i<n;i++)
    {
        printf("%6d",a[i]);
    }

    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: