//Reverse an array using DMA
#include <stdio.h>
#include<math.h>
void main(){
    int a,*p1,*p,t;
    printf("ENTER THE LIMIT OF ARRAY :\n");
    scanf("%d",&a);
    int arr[a],arr1[a];
    printf("ENTER ARRAY :\n");
    for(int i=0;i<a;i++){
        scanf("%d",&arr[i]);
    }
    for(int i=0;i<a;i++){
        printf("%d\n",arr[i]);
    }
    p = arr;
    p1 = arr1;
    for(int i=0;i<a;i++){
        *(p1 + i) = *(p + a - 1 - i);
    }
    printf("THE REVERSE OF ARRAY :\n");
        for(int i=0;i<a;i++){
        printf("%d, ",arr1[i]);
    }
}

Embed on website

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