Sunteți pe pagina 1din 1

#include<iostream> #include<conio.h> using namespace std; int main() { char str[50],wrd[15]; cout<<"Enter a string :"; cin.

getling(str,50); cout<<"Enter word which you want to found in string :"; cin>>wrd; int i=0; while(str[i]!='\0') i++; int c=0,d,e; for(int j=0;j<i;j++) { if(str[j]==' ') { c=0; } if(str[j]==wrd[c]) continue; else c=1; } if(c==1) cout<<"Word is not fornd"; else cout<<"Word is found is string"; getch(); }

S-ar putea să vă placă și