#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
void main()
{int i,k,flag=0,pos=0;
char str[30],sub[20];
cout<<"Enter a string :\n";
gets(str);
cout<<"\nEnter the sub string to be searched :\n";
gets(sub);
for(i=0;i<strlen(str);i++)
{ for(k=0;k<strlen(sub);k++)
{
if(str[i]==sub[k])
{flag=1;
pos=i+1;
continue;}
else
{flag=0;
break;}
}
}
if(flag==1)
cout<<"\nThe sub string \""<<sub<<"\" is at position "<<pos;
else
cout<<"\nThe string is not present!";
getch();
}