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
Consider a physical transmission medium of capacity C bits/sec between two stations that have I bits of information sent/receive
levacccp [35]

Answer:

Check the explanation

Explanation:

when calculating the total time to send the I bits of information or The packet delivery time or latency which can be said to be the amount of time from when the first bit leaves the point of transmission until the last is received. When it comes to a physical link, it can be computed or determined as: Packet delivery time = Transmission time + Propagation delay.

Kindly check the attached image below to get the step by step explanation to the above question.

5 0
3 years ago
Which task might be suitable for moving into a separate function so you can re-use it from multiple places in your code?
Fudgin [204]

Answer:

The answer is "All of these could make good functions ".

Explanation:

In the given question some information is missing, that is options which can be described as follows:

a. Ask the user to confirm an input with a yes/no answer

b. Sort some input data into an ordered list

c. All of these could make good functions

d. Calculate a complex mathematical expression

A method is a collection of ordered code and provides a generic code, that is used to execute a single, connected operation.

  • A good function is a function, which takes values from the user and it will sort all the data and store in memory, and whenever we call the function, it will give the values.
  • It is also used to calculate some complex values,
8 0
3 years ago
Sino ang pinaka matalino sa math sa buong mundo​
Svetllana [295]

Answer:

lahat ng tao ay matalino kasama ka na dun kaya lang di natin ito inilalabas dahil natatamad tayo

6 0
3 years ago
Read 2 more answers
What does "ttyt" stand for?
EastWind [94]
TTYT stands for "talk to you tomorrow".
6 0
3 years ago
Read 2 more answers
Consider two different implementations of the same instruction set architecture (ISA). The instructions can be divided into four
PSYCHO15rus [73]

Answer: Find answers in the attachments

Explanation:

3 0
3 years ago
Other questions:
  • ____________________ is the premeditated, politically motivated attacks against information, computer systems, computer programs
    6·2 answers
  • In an inheritance situation, the new class that you create from an existing class is known as the:
    5·1 answer
  • What is the exact number of bits in a memory that contains (a) 128k bits?
    9·1 answer
  • How can you autohide the taskbar in Windows 10?
    8·2 answers
  • What is the primary reason that organizations change their structure through downsizing, outsourcing, and offshoring as a means
    14·1 answer
  • Describe how catching exceptions can help with file errors. Write three Python examples that actually generate file errors on yo
    12·1 answer
  • 1.What is the term referring to an amount of money that is owed?
    6·2 answers
  • 23. ____________ is a slide that is used as the base design theme for other slides.​
    11·1 answer
  • An IP address specifically belongs to:
    10·1 answer
  • 10.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!