Address in C

#include <stdio.h>

int main() {
    int num = 10;  // Declare an integer variable named 'num' and initialize it with the value 10.
    int *ptr;      // Declare an integer pointer variable named 'ptr'.

    ptr = &num;    // Assign the address of 'num' to the pointer variable 'ptr'.

    printf("Value of num: %d\n", num);      // Print the value of 'num'.
    printf("Address of num: %p\n", &num);   // Print the address of 'num'.
    printf("Value at the address stored in ptr: %d\n", *ptr);  // Print the value at the address stored in 'ptr'.
    printf("Address stored in ptr: %p\n", ptr);  // Print the address stored in 'ptr'.

    return 0;
}