#include<conio.h>
#include<stdio.h>
 
int length(char x[])
{
    int i;
    for(i=0;x[i]!='\0';i++)
    {}
    return i;
}
int main()
{
    char s[20],p[20];
 
int i,l,count=0;
 
printf("\n enter Your String   =  ");
scanf("%s",s);
printf("enter the string to be matched = ");
scanf("%s",p );
l=length(p);
 
    for(i=0;s[i]!='\0';i++)
    {
      if(s[i]==p[count] )
        count++;
    else
    {
        count=0;
    }
      if ( count == l )
        {
            printf("Substring %s found in the given string",p);
         break;
        }
    }
    if(count!=l)
    printf("not found");
 
getch();
}