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
laila [671]
2 years ago
14

How do you create a function in C++

Computers and Technology
1 answer:
MArishka [77]2 years ago
7 0

Answer:

1. Declaration: the return type, the name of the function, and parameters (if     any)

2. Definition: the body of the function (code to be executed)

Explanation:

You might be interested in
Write a void function SelectionSortDescendTrace() that takes an integer array, and sorts the array into descending order. The fu
salantis [7]

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

void SelectionSortDescendTrace(int numbers[], int numElems) {

int maxInd;

for (int i = 0; i < numElems - 1; ++i) {

maxInd = i;

for (int j = i; j < numElems; ++j) {

if (numbers[j] > numbers[maxInd]) {

maxInd = j;

}

}

int temp = numbers[i];

numbers[i] = numbers[maxInd];

numbers[maxInd] = temp;

for (int j = 0; j < numElems; j++) {

cout << numbers[j] << " ";

}

cout << endl;

}

}

int main() {

int numbers[10];

int numElements = 0;

for (int i = 0; i < 10; i++) {

cin >> numbers[i];

if (numbers[i] == -1)

break;

++numElements;

}

SelectionSortDescendTrace(numbers, numElements);

return 0;

}

8 0
3 years ago
What will be the value of x after the following loop terminates?
Katena32 [7]

Answer:

10

Explanation:

This for-loop is simply iterating three times in which the value of x is being set to the value of x * 1.  So let's perform these iterations:

x = 10

When i = 0

x = x * 1 ==> 10

When i = 1

x = x * 1 ==> 10

When i = 2

x = x * 1 ==> 10

And then the for-loop terminates, leaving the value of x as 10.

Hence, the value of x is equal to 10.

Cheers.

7 0
3 years ago
Any file that contains data but not instructions for your computer is not considered software
DIA [1.3K]
True. 

But then again, partly false. A .deb file (Debian, Ubuntu Linux) contains data, but that data needs to be installed and marked executable to make the software.

But i would still say true.
5 0
3 years ago
Please help! Game design!
kvasek [131]

Answer:

player vs anonymous players

4 0
3 years ago
_______ provide additional information and request user input.
lapo4ka [179]
The Dialog Box gives extra data and demand client input. The Dialog Box is thought to be a transitory window an application makes to recover client input. An application regularly utilizes exchange boxes to incite the client for extra data for menu things. An exchange box for the most part contains at least one controls with which the client enters content, picks alternatives, or coordinates the activity.
4 0
3 years ago
Read 2 more answers
Other questions:
  • ___ are limited computers because they are placed inside devices which require specific computing functions
    11·1 answer
  • A properYour customer has connected a 1000-watt microwave oven and a 600-watt mixer to a 15-amp branch service line for the kitc
    11·2 answers
  • You have been tasked with designing an Ethernet network. Your client needs to implement a very high-speed network backbone betwe
    8·1 answer
  • Benching system are prohibited in
    5·1 answer
  • The picture that graphically represents the items you use in Windows is called a/an <br> ___?
    14·1 answer
  • When should you save your document?
    15·2 answers
  • Note oj cyber security​
    6·1 answer
  • Which tool can effectively increase the curl of the subject’s lips?
    10·2 answers
  • What are the steps to view two different versions of the same document at once?
    11·1 answer
  • A large retail company hires several new joiners and would like to incorporate Virtual Reality (VR) into their onboarding proces
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!