Question: Given the strings s 1 and s 2 that are of the same length, create a new string consisting of the last character of s

 Given the strings s 1 and s 2 that are of

Given the strings s 1 and s 2 that are of the same length, create a new string consisting of the last character of s followed by the last character of s2, fol lowed by the second to last character of s1, followed by the second to last character of s2, and so on (in other words the new string should consist of alte mating characters of the reverse of s1 and s2 ). For example. if s1 contained "hello" and s2 contained "world", then the new string should contain "odil Ireohw*. Assign the new string to the variable s3. Additional Notes: s1 and s2 should not be modified

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!