[Solved] : Question 157326

Write a C++ program in which, read three c-string str, pat and rpat from user. Now your task is to find pat in str, replace pat with rpat in str if pat is found else display a message pat not found. Example 1 Example 2 Example 3 Example 4 Input: Str: abcdefabcdkuiyh Pat: abcd Rpat: xyz Output: After replace: Str: xyzefxyzkuiyh Input: Str: abcdefabcdkuiyh Pat: ab Rpat: xyz Output: After replace: Str: xyzcdefxyzcdkuiyh Input: Str: abcdefabcdkuiyh Pat: abc Rpat: xyz Output: After replace: Str: xyzdefxyzdkuiyh Input: Str: abcdefabcdkuiyh Pat: abcdefg Rpat: xyz Output: Pat not found Str: abcdefabcdkuiy


Expert Answer


Answer to : Question 157326

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?