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
when happens when the quantity of a good supplied at a given price is greater than the quantity demanded
Norma-Jean [14]

If there is a bigger supply than demand, it is called a surplus.

8 0
3 years ago
Read 2 more answers
Mrs. Schlair has an annual salary of $96,402.<br> a. What would her semimonthly salary be?
amid [387]

Answer:$4016.75

Explanation:64333/24

3 0
3 years ago
Which view is most often used to reorder slides in a presentation that has already been created?
riadik2000 [5.3K]

Answer:

Normal view

Explanation:

The normal view is best used because it is just to drag and drop

4 0
3 years ago
Read 2 more answers
To change the overall design of an entire document to include colors, fonts, and effects, a user should apply a _____.
Olenka [21]
User should apply a theme.

Hope this helps!
8 0
3 years ago
Read 2 more answers
Hi guys help me plz . How to get ios 10 zip file for android devices ? or how to port ios 10 or higher for htc one me ?
Vladimir79 [104]
While you set up your new iOS device, look for the Apps & Data screen. Then tap Move Data from Android. (If you already finished setup, you need to  erase your iOS device and start over. If you don't want to erase, just transfer your content manually<span>.)</span>
4 0
3 years ago
Other questions:
  • What is the curriculum of digital literacy
    6·1 answer
  • Which of the following is an unintended consequence of pesticide use on crops?
    10·1 answer
  • Operating software is a must in every software (a) True (b) False
    8·1 answer
  • You might have trouble interpreting a message if:
    15·1 answer
  • Chegg A full bootstrap program Select one: a. may be infected by viruses. b. is stored in ROM to ensure to avoid any infection f
    13·1 answer
  • This is my paragraph . The type of color is ude in this code line is ..............................
    5·1 answer
  • Is it possible to construct a wait-free n-thread PeekableStack(2) object from an arbitrary number of atomic Stack objects and at
    11·1 answer
  • If you get your foot stuck in a cloud how many colors can you smell with you ears
    8·1 answer
  • Why are digital signals an accurate and reliable way to record and send information?
    13·1 answer
  • Collection activities acquire and extract data from the operational environment such that Processing and Exploitation can conver
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!