C Program to Print Address of Variables

In this program, we will learn how to print addresses of variables that you created in program.



Source Code
#include<stdio.h>
#include<conio.h>
void main()
{
    int a,b;
    clrscr();
    a=5;
    b=10;
    printf("\n Value of a=%d",a);
    printf("\n Address of a=%u",&a);
    printf("\n Value of b=%d",b);
    printf("\n Address of b=%u",&b);
    getch();
}
Output
Value of a=5
Address of a=6356748
Value of b=10
Address of b=6356744