C Program to Print Addresses of Variables

main()
{
int x=65;
char a=’a’;
float p=6.5,q=9.12;
//clrscr();

printf("%c is Stored at Address %u\n",a,&a);
printf("%d is Stored at Address %u\n",x,&x);
printf("%f is Stored at Address %u\n",p,&p);
printf("%f is Stored at Address %u\n",q,&q);
getch();

}
OUTPUT:

a is Stored at Address 2686747
65 is Stored at Address 2686748
6.500000 is Stored at Address 2686740
9.120000 is Stored at Address 2686736

Leave a Reply

Your email address will not be published. Required fields are marked *