Write a program that allows the user to enter 5 whole numbers. The program should display the numbers forwards (in line 1) and backwards (in line 2). Sample Output: Enter 5 numbers: 5 9 3 4 1 Forwards: 5,9,3,4,1, Backwards: 1,4,3,9,5.
Added by Amber H.
Close
Step 1
Step 1: Understand the task — input 5 whole numbers and output them on one line in the original order (Forwards) and on the next line in reverse order (Backwards). Show more…
Show all steps
Your feedback will help us improve your experience
Oswaldo Jiménez and 76 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
(Reverse the numbers entered) Write a program that reads a list of integers and displays them in the reverse order in which they were read.
(Reverse the numbers entered) Write a program that reads ten integers and displays them in the reverse of the order in which they were read.
Write a program that reads a four-digit integer, such as 2014, and then displays it, one digit per line in reverse order, like so: 4 1 0 2 Your prompt should tell the user to enter a four-digit integer. You can then assume that the user follows directions. (Hint: Use the division and remainder operators.)
Shelayah R.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD