My problem is to develop a program that looks for a text in a paragraph and replace it with other text. In terms of implementation, you will need three character arrays.
1. Paragraph: To store the paragraph entered by the user (use gets(paragraph); ).
2. Find: To store the text that the user wants to find in the paragraph. (use gets(find); ).
3. Replace: To store the text that the user wants to replace with the text in Find. (use gets(replace); ).
For simplicity the size of the text that user enters in find and the size of the text that the user enters in replace may be assumed to be equal.
Example:
Input:
Paragraph: “Today is Thursday. It is raining. I am glad I was able to implement the card game and submit it in time. I can now relax in the night.”
Suppose the text that the user enters in Find is: “in”, and
Suppose the text that the user enters in Replace is “AB”
Output:
Paragraph becomes: “Today is Thursday. It is raABABg. I am glad I was able to implement the card game and submit it AB time. I can now relax AB the night.”
Star t the program with three character arrays:
char paragraph[100], find[10], replace[10];
i cannot use functions other than strcmp,strcpy,gets..for loops are allowed