- 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 47 times
Problem 2: Write a program which has this following function defined void reverse(char *original_str, char *word); for r
-
- 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
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