#include <stdio.h>

int main(void) {

    // Declare variables
    int x;
    int y;

    // Declare pointers (* format)
    int* ptr1;
    int* ptr2;

    // Set pointers to the memory addresses of x and y
    ptr1 = &x;
    ptr2 = &y;

    *ptr1 = 10; // Changes the value of x to 10
    *ptr2 = 20; // Changes the value of y to 20

    // Print memory addresses and values
    printf("The value of x at memory address %d is: %d\n", ptr1, *ptr1);
    printf("The value of y at memory address %d is: %d\n", ptr2, *ptr2);

    ptr1 = ptr2; // Changes where ptr1 is pointing

    printf("Checking values of x and y using ptr1 and ptr2: %d and %d\n", *ptr1, *ptr2);
    printf("Checking the values of x and y using x and y: %d and %d\n", x, y);

    *ptr1 = *ptr2; // Sets value of y to y

    printf("Checking to see if the value of *ptr1 equals *ptr2: %d and %d\n", *ptr1, *ptr2);

    return 0;

}