Question: //done in C please Write a program that reads from the user some text in a string str that can hold a maximum of 40
//done in C please
Write a program that reads from the user some text in a string str that can hold a maximum of 40 characters and then it splits the string into two other strings as follows: all the even-position characters are copied into a string called even and all the odd-position characters are copied into a string called odd. The program should then print out the even and odd strings. Your program should use char * variables (pointer to char) to traverse the strings str, even and odd .
The program should behave as follows (items in italics are entered by the user):
Enter a string (40 characters maximum): abcdefg
The even string is: aceg
The odd string is: bdf


Write a program that reads from the user some text in a string str that can hold a maximum of 40 characters and then it splits the string into two other strings as follows: all the even-position characters are copied into a string called even and all the odd-position characters are copied into a string called odd. The program should then print out the even and odd strings. Your program should use char * variables (pointer to char) to traverse the strings str, even and odd. The program should behave as follows (items underlined are entered by the user) Enter a string (40 characters maximum): abcdefg The even string is: aceg The odd string is: bdf
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
