#include<stdio.h>
char *fun(char *a,char *b)
{
char *t,*r,*s;
s="NULL";
while(*a!='\0')
{
t=a;
r=b;
while(r!='\0')
if(*t==*r)
{
t++;
r++;
}
else
break;
if(*r=='\0')
s=a;
a++;
}
return s;
}
int main()
{
char a[100],b[100];
char *p;
printf("enter string:");
gets(a);
printf("enter substring:");
gets(b);
p=fun(a,b);
printf("the result is:%s",p);
return 0;
}