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
dedylja [7]
3 years ago
11

Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 38 then the outpu

t is: 83 Your program must define and call a function. SwapValues returns the two values in swapped order. void SwapValues (int* userVali, int* userVal2) LAB ACTIVITY 6.22.1: LAB: Swapping variables 22.1. LAB 0/10 ] main.c Load default template... #include /* Define your function here */ int main(void) { Ovo AWN /* Type your code here. Your code must call the function. */ return 0; 10 }
Computers and Technology
1 answer:
Likurg_2 [28]3 years ago
6 0

Answer:

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

#include <iostream>

using namespace std;

//define function for swapping

void SwapValues(int* userVal1,int* userVal2){  

//set integer variable to store the value

int z = *userVal1;

//interchange their value

*userVal1 = *userVal2;  

//interchange their value

*userVal2 = z;

}

//define main method

int main()

{    

//declare variables

int x,y;

//get input from the user

cin>>x>>y;

//Call the method to swap the values

SwapValues(&x,&y);

//print their values

cout<<x<<" "<<y;

return 0;

}

<u>Output</u>:

3 8

8 3

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, we define required header file and function 'SwapValues()', pass two pointer type integer variables in argument that is 'userVal1' and 'userVal2'.
  • Set integer data type variable 'z' and initialize the value of 'userVal1' in it, then initialize the value of 'userVal2' in 'userVal1' and then initialize the value of 'z' in 'userVal2'.
  • Finally, define the main method in which we set two integer type variables and get input from the user in it then, call and pass those variables and print it.
You might be interested in
What are advantages and disadvantages of developing a more robust Internet of Things and continuing to add more smart nodes?
lubasha [3.4K]
Your stored entertainment files are more secure when connected to a home network.
6 0
4 years ago
Select the three careers in the creative side of digital media.
MrRa [10]

Answer:

I would pick A B and D to be my answer

6 0
3 years ago
What should you do first when designing a program?
Nady [450]

Answer: talk about da progrm

Explanation:

6 0
3 years ago
Read 2 more answers
A technician is dispatch to troubleshoot a user's computer.
Margarita [4]

Answer:

All of the above.

Explanation:

Thrashing or drive or disk thrashing occurs when the hard drive is stressed with transferring information between the system memory and virtual machine excessively. In thrashing, there is a large number of processes running in the system and the system memory is too small to handle all processes. Thrashing leads to decreased system performance and hard disk failure.

To stop the impact of thrashing, install more RAM, end unimportant progam processes etc.

5 0
3 years ago
When you enable user access control (uac)
SVEN [57.7K]
The UAC is on by default. So, you don't need to turn it on unless someone else turned it off.

The UAC has four modes.

The lowest mode is the off position. If the UAC is off, no UAC prompt will pop up when doing administrative tasks.

6 0
3 years ago
Other questions:
  • What are examples of educational obstacles to a career plan?
    13·1 answer
  • How can vlan hopping attacks be prevented on a network?
    10·1 answer
  • When you move a paragraph in a document that includes text with a footnote, what happens to the footnote reference?
    7·2 answers
  • In reduced visibility conditions you need to work especially hard to gather visual information because
    7·1 answer
  • During a night flight, you observe a steady red light and a flashing red light ahead and at the same altitude. What is the gener
    11·1 answer
  • Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop shou
    5·1 answer
  • In order for bitlocker to protect the system volume without the aid of an external drive, your computer must:
    12·2 answers
  • Fill in this function that takes three parameters, two Strings and an int. 4- // Write some test function calls here! The String
    9·1 answer
  • Ivan wants to have code in a game that will make it possible to change the speed of a swimmer in the game. Which of these does I
    8·1 answer
  • How can you have internet without subscribing to cable?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!