/*...........++++++++++++++++STRING SEARCH +++++++++++..... ........++++++AUTHOR: Mehedi Hasan+++++++++.......... ......++++++++++++++DAT-2731+++++++++++++++++++++............. */ void MSTR(void); void SSTR(void); int i,j,ss=0,S=0; char mstr[30],sstr[10]; main() { clrscr(); MSTR(); SSTR(); if(S==0) printf("\n\n Not Found !!!"); getch(); } void MSTR(void) { printf("\n\n Enter Main String....\n = "); gets(mstr); } void SSTR(void) { printf("\n\n Enter Serach String....\n ="); gets(sstr); printf("\n\n String Location....\n "); for(i=0; i<strlen(mstr); i++) printf("\n %c=%d",mstr[i],i+1); for(i=0; i<strlen(mstr); i++) { for(j=0; j<strlen(sstr); j++) { if(mstr[i+j]==sstr[j]) ss++; } if(ss==strlen(sstr)) { printf("\n\n Location=%d",i+1); printf(" TO %d ",i+strlen(sstr)); S=1; } ss=0; } }