130k views
3 votes
In the code segment below, assume that the int array numArr has been properly declared and initialized. The code segment is intended to reverse the order of the elements in numArr. For example, if numArr initially contains {1, 3, 5, 7, 9}, it should contain {9, 7, 5, 3, 1} after the code segment executes. /* missing loop header */

User Allan Ho
by
5.4k points

1 Answer

0 votes

Answer:

for (k=4 ; k>=0; k--)

{

cout<<numArr[k];

}

Step-by-step explanation:

If

first index of array = 0

then

last index will be = 4

so loop will starts from 4 and ends at 0. to print the array in reverse order.

User Norbert Dopjera
by
5.0k points