Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Saturday, February 19, 2011

C25 : Print variable value and its address by using pointer

Back to Home   &  C


//Program to print a variable value and its address by using pointer

#include<stdio.h>
#include<conio.h>
void main()
{
int n,*pt;
clrscr();
printf("Enter a number\n");
scanf("%d",&n);
pt=&n;
printf("address of variable=%u\n",pt);
printf("Value of variable=%d",*pt);
getch();
}
----------------------------------------------------
Output
Enter a number
23
Address of variable=65524
Value of variable=23
===============================================
Back to Home   &  C

1 comment:

Anonymous said...

why u use * in value
and not use in address .....