#include <stdio.h>
#include <conio.h>
main()
{
char *a1,*a2,ch;
char * xstrchr(char *,char);
clrscr();
fflush(stdin);
printf("ENTER THE STRING:->");
scanf("%[^\n]s",a1);
fflush(stdin);
printf("\nENTER THE CHARACTER WHICH YOU WANT TO SEEK:->");
scanf("%c",&ch);
a2=xstrchr(a1,ch);
if (a2==NULL)
printf("THE CHARACTER %c IS NOT FOUND IN THE STRING.",ch);
else
printf("THE CHARACTER %c FOUND AT ADDRESS %u",ch,a2);
getch();
}
char * xstrchr(char *str,char ch)
{
int i=0;
while(str[i]!='\0')
{
if(str[i]==ch)
return(&str[i]);
i++;
}
return NULL;
}