Question: Please help me with this one. I've tried all the ways to make a for loop but it was unsuccessful with the i + +

Please help me with this one. I've tried all the ways to make a for loop but it was unsuccessful with the i++ operation as well as it is not possible for me to move on.
Letters Between
Design a program named letters_between.c that accepts a starting letter and target letter as input. The program
should calculate the shortest path between the two given letters by either moving forwards or backwards through the
alphabet. The program then prints out all the letters from the starting letter to the target letter along the shortest path.
For example, if 'c' and 'k' were entered as the starting and target letters respectivley, the program would
calculate the path moving forwards through the alphabet to be cdefhijk, which takes 8 letters and the
the path moving backwards through the alphabet to be cbazyxwvutsrqponmlk, which takes letters.
Hence the program will print cdefhijk as 8 letters is less than 19.
Note In the case where the number of letters are equal, the program will print the letters moving forwards through the
alphabet.
HINT:
To ensure correct input handling, you might want to include a space before the
specifier in the scanf
function for reading characters to help clear any preceding whitespace characters or newline characters left in
the input buffer from previous inputs.
 Please help me with this one. I've tried all the ways

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!