#include <stdio.h>

int main() {
    int y=0;
    
    int arr[6]= {1, 2, 3, 4, 5, 6};

    int * ptr = &arr[0];
    int * ptr2 = &arr[5];

    for(int i=0; i<3; i++)
    {
        y = *ptr;
        *ptr = *ptr2;
        *ptr2 = y;
        ptr ++;
        ptr2 --;
    }

    for(int i=0; i<6; i++)
    {
        printf("%d ", arr[i]);
    }
    return 0;
}

Embed on website

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