0

:sad: There is a programming question. This is searching program. there is a string array. In this string array ther is a sentence. I get a word from the user . When the user's word is match with the sentence that is in the string , a message will appear ( found!!) and the number of count else (Not found!!).
My coding:
main()
{
int count ;
char st1[80],st2[80];
char st[80]={ ncc education examination ncc ncc ncc education};
cout<< "Enter a word to be search";
cin>> st[];
int i=0;
{

while(st!='/0')
{ st3=st1;
st3++;
while((isspace(st)))
if( stcmp(st1,st3));
count++;
{cout<< "found";}
else {cout<<"Not fjound!!";}
}
st1++;
}
}
Please test this program is wrong or true .If in this program have a little wrong please correct it

3
Contributors
2
Replies
3
Views
12 Years
Discussion Span
Last Post by peter_budo
0

1. Use complete sentences to describe what you are trying to accomplish so someone can understand what you are asking. So they do not have to lower themselves to a third grade level of reading to know what you are trying to ask.

2. Use code tags when posting code.

3. main returns an int it should be int main.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.