#include <stdio.h>

int main() {
    // an array.
    int a[] = {10, 20, 30, 40};

    // a pointer p, with the same value as a.
    int *p = a;

    // a loop variable.
    int i = 0;

    // printing the elements with pointer increments.
    for (i = 0; i < 4; i++) {
        printf("%d\n", *p);
        p++;
    }

    return 0;
}

Embed on website

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