//WAP to input a value/number and display its address with value using pointer.
#include<stdio.h>
#include<conio.h>
void main()
{
int *p;
int number;
printf("enter a number\n");
scanf("%d",&number);
p=&number;
printf("the address is=%d\n",p);
printf("the value is=%d\n",*p);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int *p;
int number;
printf("enter a number\n");
scanf("%d",&number);
p=&number;
printf("the address is=%d\n",p);
printf("the value is=%d\n",*p);
getch();
}
No comments:
Post a Comment