#include <stdio.h>

int main() {
    int a = 10;

    // get the address of a and store it in p.
    int *p = &a;

    // add 10 to p and store it in q.
    int *q = p + 10;

    // subtract 10 from p and store it in r.
    int *r = p - 10;

    // print the addresses in p, q and r.
    printf("the address stored in p is %zu\n", p);
    printf("the address stored in q is %zu\n", q);
    printf("the address stored in r is %zu\n", r);

    return 0;
}

Embed on website

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