C PROGRAMMING

write a c program to print address and values of pointer

#include <stdio.h>
main() {
int a;
int *pt;
printf("Pointer Example Program : Print Pointer Addressn");
a = 10;
pt = &a;
printf("n[a ]:Value of A = %d", a);
printf("n[*pt]:Value of A = %d", *pt);
printf("n[&a ]:Address of A = %p", &a);
printf("n[pt ]:Address of A = %p", pt);
printf("n[&pt]:Address of pt = %p", &pt);
printf("n[pt ]:Value of pt = %p", pt);
getch();
}

Related Articles

Leave a Reply

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

Back to top button