Write a program for the demonstration of Pointers

//this is a program for the demonstration of Pointers
#include<stdio.h>
#include<conio.h>
void main()
{
int x;

int *ptr;

ptr=&x;

printf("\n\nEnter any number: ");
scanf("%d",ptr);

printf("\n\nWithout Pointers: ");
printf("\n\nValue stored in x=%d",x);
printf("\n\nAddress of X=%u",&x);

printf("\n\nWith Pointers: ");
printf("\n\nValue stored in x=%d",*ptr);
printf("\n\nAddress of X=%u",ptr);

}

Previous
Next Post »