subject

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

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 01:10, jaileen84
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates. json” file), in order of closest-to-farthest from the origin.
Answers: 1
image
Computers and Technology, 24.06.2019 02:30, sha273
Which option completes the explanation for conflict of interest in an organization
Answers: 1
image
Computers and Technology, 25.06.2019 01:30, jamesvazquez3135
The physical parts or components of a computer system is called .
Answers: 1
image
Computers and Technology, 25.06.2019 03:00, reearamrup27
Match the categories in the first column with examples in the second column. 1. good for watching movies 2. maximum power with small size 3. older style mobile devices that may or may not have internet connectivity tablet computer a.)pda b.)smart phone c.)tablet computer
Answers: 1
You know the right 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, 18.09.2021 08:20
Konu
Computers and Technology, 18.09.2021 08:20