Question: Write a program that receives three inputs from a user: a word / phrase , a starting index, and a stopping index. Use the indexes

Write a program that receives three inputs from a user: a word/phrase, a starting index, and a stopping index. Use the indexes given by the user to get the appropriate slice from the word/phrase, then output the result.
word/phrase index 1 index 2 result
bicycle 25 cyc
sunshine 17 unshin
Elephant 05 Eleph
Entire string! 014 Entire string!
Example output/input:
enter a string:
bicycle
enter the first index:
2
enter the second index:
5
The characters from index 2 to index 5 in the phrase "bicycle" are cyc.

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!