Question: Consider the sequence: 2 , 1 8 , 1 6 2 , 1 4 5 8 , 1 3 1 2 2 , 1 1
Consider the sequence:
Create a program that asks the user to enter two numbers X and Y with X less than Y Then the program displays all of the numbers in the above sequence starting with the number in the sequence in position X and ending with the number in the sequence in position Y
For example, if the user enters and the program displays the numbers and
Note:
The inputs X and Y are position numbers in the sequence, not actual numbers in the sequence. For example, X means the number in the sequence in second position in the sequence in this case
The program outputs all of the numbers in the sequence in between the Xth and Yth positions in the sequence. For example, X and Y means the program will output all of the numbers in the sequence starting at the third position and ending at the sixth position.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
