//progrm to print address and value of a string given by user.
#include <stdio.h>
int main()
{
char name[30];
char *p;
int i=0;
printf("enter the string\n");
scanf("%s",name);
p=name;//assigning base address
while(*p!='\0')//condition testing
{
printf("the address=%d and value=%c\n",p+i,*p);//printing value and address
*p++;//changing the value
i++;//changing the value of i
}
return 0;
}
#include <stdio.h>
int main()
{
char name[30];
char *p;
int i=0;
printf("enter the string\n");
scanf("%s",name);
p=name;//assigning base address
while(*p!='\0')//condition testing
{
printf("the address=%d and value=%c\n",p+i,*p);//printing value and address
*p++;//changing the value
i++;//changing the value of i
}
return 0;
}