Print address of variable using pointer - C - A6P4



/* Write a program to print address of variable using pointer */

#include<stdio.h>
#include<conio.h>
void main()
{
     int var;
     int *p;
     clrscr();
     printf("Enter Value of Variable -> ");
     scanf("%d",&var);
     p=&var;
     printf("Value of Variable   -> %d \n",var);
     printf("\nAddress of Variable without using pointer -> %d ",&var);
     printf("\nAddress of variable Using Pointer         -> %d ",p);
     getch();

}

Post a Comment