String Search

  • Uploaded by: Mehedi Hasan
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View String Search as PDF for free.

More details

  • Words: 81
  • Pages: 1
/*...........++++++++++++++++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; } }

Related Documents

String Search
November 2019 31
String
June 2020 26
Search Search
October 2019 35
Search Search
October 2019 41
Search
October 2019 81
Search
June 2020 15

More Documents from ""

Some Important Program
November 2019 28
String Search
November 2019 31
Compiler Design
November 2019 29
Tips By Mehedi
December 2019 28