write a c program to print the address of pointer numbers

Write a c program to print the address of pointer numbers. A pointer is a variable whose value is the address of another variable, or the memory location’s direct address. Before using a pointer to store any variable address, just like any other variable or constant, you must declare it.

#include <stdio.h>
int main()
{
int var = 2; 
int *p;
p = &var; 
printf("Address of the variable %d \n\n", &var);
printf("\n\nAddress stored in pointer variable p is: %d", p);
printf("\n\nValue of var variable %d ", *p);
return 0;
}

Output:

Address of the variable -1330026908

Address stored in pointer variable p is: -1330026908

Value of var variable 2