1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivahew [28]
3 years ago
14

5.8.1: Modify an array parameter. Write a function SwapArrayEnds() that swaps the first and last elements of the function's arra

y parameter. Ex: sortArray = {10, 20, 30, 40} becomes {40, 20, 30, 10}. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #include using namespace std; /* Your solution goes here */ int main() { const int SORT_ARR_SIZE = 4; int sortArray[SORT_ARR_SIZE]; int i; int userNum; for (i = 0; i < SORT_ARR_SIZE; ++i) { cin >> userNum; sortArray[i] = userNum; } SwapArrayEnds(sortArray, SORT_ARR_SIZE); for (i = 0; i < SORT_ARR_SIZE; ++i) { cout << sortArray[i] << " "; } cout << endl; 1 test passed All tests passed Run

Computers and Technology
1 answer:
viktelen [127]3 years ago
3 0

Answer:

see explaination

Explanation:

#include<stdio.h>

/* Your solution goes here */

//Impllementation of SwapArrayEnds method

void SwapArrayEnds(int sortArray[],int SORT_ARR_SIZE){

//Declare tempVariable as integer type

int tempVariable;

if(SORT_ARR_SIZE > 1){

tempVariable = sortArray[0];

sortArray[0] = sortArray[SORT_ARR_SIZE-1];

sortArray[SORT_ARR_SIZE-1] = tempVariable;

}

}

int main(void) {

const int SORT_ARR_SIZE = 4;

int sortArray[SORT_ARR_SIZE];

int i = 0;

sortArray[0] = 10;

sortArray[1] = 20;

sortArray[2] = 30;

sortArray[3] = 40;

SwapArrayEnds(sortArray, SORT_ARR_SIZE);

for (i = 0; i < SORT_ARR_SIZE; ++i) {

printf("%d ", sortArray[i]);

}

printf("\n");

return 0;

}

Please go to attachment for the program screenshot and output

You might be interested in
Select the correct answer.
trapecia [35]
OA. programs do not represent data-rate to xomolemrixjf complexity
6 0
4 years ago
In order to make schemas that will appear in the Schema Library available in the XML Options dialog box, what file extension sho
Luba_88 [7]

Answer:

You can use your XML parser

Explanation:

hope this helps!

5 0
3 years ago
The number of worksheets a workbook can contain is limited to the ______ of your computer.
KiRa [710]
<span>The number of worksheets a workbook can contain is limited to the memory of your computer.
The computer memory denotes the </span><span>hardware integrated circuits in the computer. These circuits store information for immediate use in a </span><span>computer, for worksheets for example.</span>
6 0
4 years ago
A. which chip is thought to be the first microprocessor? how many transistors roughly did it use?
vaieri [72.5K]
A micro processor is an integrated circuit that have all the functions of a central processing unit of a computer.
The chip which is thought to be the first microprocessor is INTEL 4004. It was manufactured by Intel in 1971. Intel 4004 has 2,300 transistors. 
4 0
4 years ago
Mention at least five devices used for digitizing data
creativ13 [48]
Answer:
1. Cloud Storage Solutions
2. Digital Communication Tools
3. Cloud ERP Systems
4. CRM Platforms
5. Digital Accounting Tools

For more information, please visit: https://www.gend.co/blog/the-digitisation-tools-with-the-biggest-impact-for-business?hs_amp=true

Hope this helps!!
3 0
2 years ago
Other questions:
  • Andy, a developer, is designing a new program. Which tool should Andy use to help him complete his task?
    6·1 answer
  • In an ipv4 address, what are the maximum number of bits that can be used to identify the network address
    14·1 answer
  • If a wire has insulation that allows it to operate in a temperature of up to 194 degrees Fahrenheit, what temperature will the w
    13·1 answer
  • What is achieved through xylography
    7·2 answers
  • What does an executable file contain? Program instructions written in source code. Program instructions that have been compiled
    15·1 answer
  • A GPO component that’s an Active Directory object stored in the System\Policies folder. The GPC stores GPO properties and status
    14·1 answer
  • Describe, step by step, how to create an account for a computer on the domain controller.
    11·1 answer
  • What is entered into a cell that is typically numeric and can be used for calculations?
    9·2 answers
  • Which component, located on the motherboard, carries out all the instructions provided by computer programs? ram?
    5·1 answer
  • Brian needs to see the space available to insert content on a slide in his presentation which feature of the presentation should
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!