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
Firdavs [7]
3 years ago
8

Write the definition of a function named swapints that is passed two int variables. The function returns nothing but exchanges t

he values of the two variables. So, if j and k have (respectively) the values 15 and 23, and the invocation swapints(j,k) is made, then upon return, the values of j and k will be 23 and 15 respectively.
Computers and Technology
1 answer:
lisov135 [29]3 years ago
4 0

Answer:

Following are the program in the C++ Programming Language.

#include <iostream>

//header file

using namespace std;

 //using namespace

void swapints(int &j, int &k){

 //definition of the function

int temp;

temp = j;

j = k;

k = temp;

}

// function declaration

void swapints(int &j, int &k);

int main() {

  // local variable declaration:

 int j = 15;

 int k = 23;

 std::cout << "Before the swapping, value of j : "<<j<<endl;

 std::cout << "Before the swapping, value of k : "<<k<<endl;

  /* calling a function to swap the values using variable reference.*/

 swapints(j, k);

 std::cout << "After the swapping, value of j : "<<j<< endl;

 std::cout << "After the swapping, value of k : "<<k<< endl;

 

  return 0;

}

Output:

Before the swapping, value of j : 15

Before the swapping, value of k : 23

After the swapping, value of j : 23

After the swapping, value of k : 15

Explanation:

Here, we define the header fine and namespace <iostream> and "std".

Then, we define a function named "swapints()" and pass two reference variables in parameter.

Then, inside the function, we perform the codes of swapping.

Then, we define the main() function inside it we define two integer variable "j" and "k" assign value "j" to 15 and "k" to 23 and print both the variables.

Then, inside main() function we call the function "swapints()" and pass value to its parameters.

You might be interested in
Which design approach help build sites that optimize varied screen sizes
FrozenT [24]

Adaptive design approach

Adaptive design approach offers multiple fixed layout sizes. As compared to the responsive design, adaptive design delivers separate content to users based on their specific device. Responsive design approach uses fluid grids and offers the same website across every device. On the other hand, in adaptive design, the site chooses the best layout for that screen. You can develop 6 designs for the 6 most common screen widths.


3 0
3 years ago
What type of data visual would you use to illustrate trends over time? Gantt chart Bar graph Line chart Scatter diagrams
Nana76 [90]
A line chart is perfect for the situation.
7 0
3 years ago
How do mentors provide professional development opportunities?
Sholpan [36]

The answer is the second one.

Hope this helps! :)

3 0
3 years ago
Read 2 more answers
Those persons with little in the way of hacking skills that can access and use powerful hacking tools are called _______________
KIM [24]

Answer:

Script Kiddies or "Skiddies"

Explanation:

A script kiddie, or “Skiddie,” is someone who lacks programming knowledge and uses existing software to launch an attack. Often a script kiddie will use these programs without even knowing how they work or what they do. They begin playing with the various programs while searching for online tutorials. At first, they may be perceived as nothing more than an internet troll or noob, due to their lack of experience and quickness to brag and boast. Sometimes they will even resort to cyber stalking or bullying. However , this may simply be a cover for other more nefarious activity.

3 0
4 years ago
What is the base for a hexadecimal number system?
miskamm [114]
The base for a hexadecimal number system is 16
5 0
3 years ago
Other questions:
  • In this mode, your presentation will fill up the entire screen. Auto Default Standard Window
    6·2 answers
  • 1. The acronym AUDIENCE serves to remind you of what to consider when analyzing an audience. The U for understanding. How does t
    15·1 answer
  • If a user wants to add an expansion card to increase the memory of a computer, where should the user insert the card?
    12·2 answers
  • What is pure carbon made of
    14·2 answers
  • _____ was just a sophomore when he began building computers in his dorm room at the University of Texas. His firm would one day
    14·1 answer
  • What is contrast (in Photography)?
    14·1 answer
  • Which best describes the Help feature of Word?
    13·2 answers
  • anyone here done intro to tech course on edgenuity yet? I failed the first unit test twice and it's prob gonna be a third if i r
    14·2 answers
  • Consider the following code: x = 9 y = -2 z = 2 print (x + y * z) What is output? 9 13 14 5
    5·1 answer
  • An outpatient provides the following id: barbara jones, birth date 8/15/63. should a specimen be collected for this lab order?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!