C Program Of String

#include<stdio.h>
main()
{

char a[100];
 printf("Enter your Name:\n");

 scanf("%s",a);    //not &a bcuz a[] is a one-D array which located in memeory continuosly..not randomaly...variables memeory allocated randomaly so access them correctly we use &x/y/z jo bi ho

 printf("Your name is\n%s\n",a);

}

 //Program 2

#include<stdio.h>

main()

{

char b[100];
int i;

printf("Enter string:\n");
scanf("%s",b);

while(b[i]!='\0')
{

printf("%c is located at %p\n",b[i],&b[i]);
i++;

}
}







Related Posts