Computers and Technology

Write a program to reverse a list of numbers in an array. In four steps: (a) Prompts the user for an integer, then asks the user to enter that many values.
(b) Store these values in an array and print the array.
(c) Then reverse the array elements so that the first element becomes the last element, the second element becomes the second to last element, and so on, with the old last element now first. Do not just reverse the order in which they are printed; actually change the way they are stored in the array. Do not create a second array; just arrange the elements within the array you have. (Hint: Swap elements that need to change places.)
(d) When the elements have been reversed, print the array again. Enter the number of elements in the array: 5 Enter the array elements (integers)... Enter element 1: 7 Enter element 2: 2 Enter element 3: 11 Enter element 4: 4 Enter element 5: 8 The array elements before reversing: 7 2 11 4 8 The array after reversing: 8 4 11 2 7

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:00, briannaleiigh
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year school. what is the expected total cost for one year at the local community college if kirk lives at home? what is the expected total cost for one year at the out-of-state school if kirk lives on campus?
Answers: 2
image
Computers and Technology, 22.06.2019 21:00, bryanatwin1536
Describir textbook icon_person mira los dibujos y describe lo que estΓ‘ pasando. usa los verbos de la lista.
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, reinasuarez964
One of your customers wants you to build a personal server that he can use in his home. one of his concerns is making sure he has at least one backup of their data stored on the server in the event that a disk fails. you have decided to back up his data using raid. since this server is for personal use only, the customer wants to keep costs down. therefore, he would like to keep the number of drives to a minimum. which of the following raid systems would best meet the customer's specifications? a. raid 0 b. raid 1 c. raid 5 d. raid 10
Answers: 3
image
Computers and Technology, 23.06.2019 08:30, mai1261
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
Do you know the correct answer?
Write a program to reverse a list of numbers in an array. In four steps: (a) Prompts the user for...

Questions in other subjects:

Konu
Mathematics, 19.11.2020 04:50