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
german
4 years ago
13

Write a program in C++ to swap two variables usingfunctions?

Computers and Technology
1 answer:
lilavasa [31]4 years ago
8 0

Answer:

#include <iostream>

using namespace std;

void swap(int& m, int& n)  /* passing by reference so that changes will be made in the original values.*/

{

   int t=m;

   m=n;

   n=t;

}

int main()

{

   int val1,val2;

   cout<<"Enter the values"<<endl;

   cin>>val1>>val2;

   cout<<"Values before swap "<<val1<<" "<<val2<<endl;

   swap(val1,val2); //calling the function swap..

   cout<<"Values after swap "<<val1<<" "<<val2<<endl;

return 0;

}

Explanation:

Created a function swap with 2 arguments m and n passed by reference.

You might be interested in
In total, how many 8-bit registers are there in the Intel 80x86 CPU design presented in class? Name one of these 8-bit registers
RSB [31]

Answer:

In general the number of  bit registers in Intel 80x86 CPU design when combined together forms a 16 - bit register

An example of the  -bit registers are AH, AL, BH, BL, CH, CL, DH, and DL

Explanation:

Solution

The 8086 CPU design has a total of eight 8-bit registers and these register can be integrated together to make 16- bit register as well.

The 16-bit data is stored by breaking the data into a low-order byte and high order byte.

The name of the 8 bit registers is shown below:

AH, AL, BH, BL, CH, CL, DH, and DL

7 0
3 years ago
Drive.
barxatty [35]

Answer:

22

Explanation:

5 0
2 years ago
By default, which of these traffic source dimensions does google analytics capture for each user that visits your website?
natta225 [31]

The question above has multiple choices as listed;

<span />a. Source and Medium<span>
</span>

<span>b. Campaign and Ad Content</span>
<span />

<span>c. Campaign and Medium
</span><span>
</span><span>d. Source, Medium, Campaign, and Ad Content
</span>
<span />

<span>The correct answer is A. Source and Medium</span>

Source and medium combines the dimensions source and medium. Anyone referred to a website has an origin or a source. Examples of possible sources include Google, Facebook.com, and direct for those who typed your URL directly. Every referral, on the other hand, has a medium and possible examples of medium include organic, cost per click, referral, email, and none.






5 0
3 years ago
The main parts of a lever are the....
Zanzabum
Effort,load and fulcrum
7 0
3 years ago
Read 2 more answers
What is also know as a visual aid in a presentation
harkovskaia [24]

To promote a product we need marketing. So marketing plays an important role, moreover, the demand process also is required.

<u>Explanation:</u>

Marketing for any specified product can be done by visual aid presentation. Visual Aid presentation should have a cached message to the audience and the importance of promoting’s the product and it should impact the customer to purchase products and demand for availability should increase.

Once the demand for the product increased then sales and manufacture of the product are increased. So the growth of the company is increased. So, in other words, it is called chain management  in the growth process.

6 0
3 years ago
Other questions:
  • material systems developer typically combines the skills of a programmer with the multitasking expectations of a .
    8·1 answer
  • is either the number of bits used to indicate the color of a single pixel, or the number of bits used for each color component o
    7·1 answer
  • Within the information category of functions, you will find functions that ____.
    7·2 answers
  • A small bank with several regional branches is searching for a solution to consolidate its business services into a single site
    8·2 answers
  • A technician is working at a client's office after hours and needs two cables to finish the work but does not have immediate acc
    7·1 answer
  • Software is the word for:
    15·1 answer
  • A user complains because the social media apps on his mobile device always note his location. The user is worried about privacy,
    12·1 answer
  • Who wanna be besties
    8·2 answers
  • Drag each tile to the correct box. Arrange the statements in sequence to correctly explain what the field of science includes. a
    7·1 answer
  • The process of specifying that certain rows be displayed in the results of a query is known as selection. ______________________
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!