Reference no: EM132213273
Question :
Write a recursive function that takes an array of characters as input and prints it content to the standard
output, each character on a separate line, surrounded by asterisks. For example if the array contains the
characters:
GO SPARTANS!
The function should output:
*G*
*O*
* *
*S*
*P*
*A*
*R*
*T*
*A*
*N*
*S*
*!*
Write a program split.c that asks the user to enter a number corresponding to the number of characters
to be stored. Your program should then ask the user to enter
those values and store them in an array.
Use the function you wrote to print the array content split and surrounded by asterisks.
Write another recursive function splitAndMove that prints the content of the array similar to the
previous function but with each line indented by an additional space with respect to the previous line.
For example, the array containing:
GO SPARTANS!
Will print as follows:
*G*
*O*
* *
*S*
*P*
*A*
*R*
*T*
*A*
*N*
*S*
*!*
Modify your program to ask the user how they want the array printed (aligned or indented) and print the array accordingly.