#include <stdio.h>

int main() {
    int a = 10;
    int *p = &a;

    // print the value without using a pointer.
    printf("The current value of a is %d\n", a);

    // update the value and print it through the pointer.
    *p = 20;
    printf("The updated value of a (through the pointer) is %d\n", *p);

    // verifying that the updated value also reflected
    // in the variable a.
    printf("The updated value of a (through the variable) is %d\n", a);

    return 0;
}

Embed on website

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