Problem 2: Write a program which has this following function defined void reverse(char *original_str, char *word); for r

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Problem 2: Write a program which has this following function defined void reverse(char *original_str, char *word); for r

Post by answerhappygod »

Problem 2 Write A Program Which Has This Following Function Defined Void Reverse Char Original Str Char Word For R 1
Problem 2 Write A Program Which Has This Following Function Defined Void Reverse Char Original Str Char Word For R 1 (40.63 KiB) Viewed 46 times
Problem 2: Write a program which has this following function defined void reverse(char *original_str, char *word); for reversing all occurrences of an existing word (ori-word) from an input string (original_str) and printing the resulting string. The main function in the program must only have statements necessary for receiving inputs from the user (the original string, the word to be removed and the new word) and a function call to the reverse function. You are not allowed to use any string library function except strlen. Sample Input/Output Enter original string: Hello Hi Hello How are Hello Enter the word to be reversed: Hello Resulting String: olleH Hi olleH are olleH Enter the original string: Hello Hi Hello How are Hello Enter the word to be replaced: When There was no occurrence of When in the original string. Resulting String: Hello Hi Hello How are Hello
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply