Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that performs the tasks described below. Define the following functions void A ( char str [ ] ) Takes string str and
Write a program that performs the tasks described below.
Define the following functions
void Achar str Takes string str and converts all nonletters to the character
in it
Ex: abc becomes abc
void Bchar str Swaps the first half of str with the second half of str
Ex: abcxyz becomes xyzabc
void Cchar str Reverses the order of the characters in the first half of str
Ex: abcxyz becomes cbaxyz
void Dchar str Reverses the order of the characters in the second half of str
Ex: abcxyz becomes abczyx
For the functions B C and D if the length of str is odd then the character in the middle of str
will not change.
Construct two arbitrary strings and print them on the screen. They can be at any length.
o The first one will be the string that will be manipulated by the functions above.
o The second one will contain a combination of letters A B C and D The order of
these letters in the second string represents the calling order of the related
functions.
Send the first string to the first function. Then, the updated string will be sent to the next
function as a parameter. At each function call, the updated string should be printed on
the screen.
The program should terminate after all the functions in the second string are called.
NOTES:
If you need, you can implement other necessary functions in addition to the functions
above.
You cannot use any library functions other than printf;
See the example scenario below
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started