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
3 years ago
13

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

Computers and Technology
1 answer:
lilavasa [31]3 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
Berat wants to compare images of what the streets of New York City looked like one hundred years ago to now. Which of the follow
Vesnalui [34]

Answer:

I think the answer would be D.

7 0
3 years ago
Read 2 more answers
Which of these is a requirement for developing game applications on devices running Apple’s iOS operating system?
andrey2020 [161]

Answer:

A. Xcode libraries

Explanation:

We have to find a requirement for developing game applications on devices running Apple’s iOS operating system. For that, I will evaluate each answer.

A. Xcode libraries

Xcode can be generally defined as a development kit or integrated development environment to facilitate the Apple software development. Apple use iOS operating system for its devices. To develop anything compatible with iOS, you generally have to code it using Xcode. Obviously, each development kit includes libraries for project to be built. Therefore, this option is correct.  

B. Android Development Kit

Just like Xcode, Android Development Kit is used to build the software for android. It is pretty much comprehensible from its name. So,  this option is false.  

C. ARM technology  and D. advanced microprocessors

These both options are related to hardware and available on both the devices. It is used for overall processing but these options are not that relevant to iOS operating system. Therefore, these options are false too.

So, Correct option is Xcode libraries.

5 0
3 years ago
Read 2 more answers
Hey yall wanna send me some just ask for my phone #
GuDViN [60]

Answer:

Send you some what?

Explanation:

the answer is 12

7 0
3 years ago
Given the variables isfulltimestudent and age, write an expression that evaluates to true if age is less than 19 or isfulltimest
Pani-rosa [81]
Which language is this in?

if (age<19||isfulltimestudent==true)
    return true;
6 0
3 years ago
Which is NOT a way the network operating sys-
irakobra [83]

Answer: A user authentication

3 0
3 years ago
Other questions:
  • As yall know its spoopy season. This means spoopy music! I am having a live stream on the Spoon app under the username teendrago
    11·1 answer
  • When CPU failed what will happen?
    10·1 answer
  • Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
    15·1 answer
  • Give a real life of an if statement
    13·1 answer
  • During which phase of the website transformation processwould the project team for developing perform content analysis, layout t
    13·1 answer
  • Erewrxdnnefwn q wedsvd
    6·1 answer
  • LAB: Convert to binary - methods
    11·1 answer
  • Where is 5G being used and how fast is it?​
    5·2 answers
  • You saved a file on drive C go your computer. You want to find and open the file. Which of the following programs will you use t
    14·1 answer
  • What are the top 10 most dangerous computer viruses ?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!