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
swat32
3 years ago
11

Write a program whose input is two integers and whose output is the two integers swapped.

Computers and Technology
1 answer:
Tpy6a [65]3 years ago
5 0

Answer:

The program to this question can be given as:

Program:

#include <iostream>  //header file

using namespace std;   //using namespace.

void SwapValues(int* userVal1, int* userVal2); //function declaration.

void SwapValues(int* userVal1, int* userVal2) //function definition.

{ //function body.

//perform swapping

   int t = *userVal1;  

   *userVal1 = *userVal2;

   *userVal2 = t;

}

int main() //main method  

{

int n1, n2; //define variable

cout<<"Enter first number :"; //message

cin>>n1; //input by user.

cout<<"Enter second number :"; //message  

cin>>n2; //input by user.

SwapValues(&n1,&n2); //calling function.

cout<<"Swapped values"<<endl;

cout<<"first number is :"<<n1<<endl; //print value

cout<<"second number is:"<<n2<<endl; //print value

return 0;

}

Output:

Enter first number :3

Enter second number :8

Swapped values

first number is :8

second number is :3

Explanation:

The description of the above C++ language program can be given as:

  • In the program, firstly we include the header file. Then we declare and define a function that is "SwapValues()" function in the function we pass two integer variable that is "userVal1 and userVal2" inside a function, we define an integer variable that is "t" and perform swapping.  
  • Then we define the main function in the main function we define two variables that is "n1 and n2" this variable is used to take value-form user. then we pass this value to function and print the function values.

You might be interested in
Which operation is not efficiently supported by heaps?
vodka [1.7K]

In the case above, the operation is not efficiently supported by heaps is Find.

<h3>What are heap operations?</h3>

The operation that are known to often use heaps are:

  • Heapify
  • Find-max (or Find-min)
  • Insertion, etc.

Therefore, In the case above, the operation is not efficiently supported by heaps is Find.

See full question below

Which operation is not efficiently supported by heaps?

a. DeleteMin

b. Find

c. FindMin

d. Insert

e. all of the above are sufficiently supported

Learn more about operation from

brainly.com/question/24214198

#SPJ11

6 0
2 years ago
A(n) ____ describes the structure, content, and access controls of a physical data store or database.
kirill115 [55]

A <u>schema </u>describes the structure, content, and access controls of a physical data store or database.

<h3>What is the kind of database that stores data in a different physical location?</h3>

Distributed databases are that are distributed across several physical locations. In distributed databases, the data are placed where they are used most often, but the whole database is available to each licensed user.

<h3>What is the structure of database management system?</h3>

The database system is separated into three components: Query Processor, Storage Manager, and Disk Storage.

To learn more about Distributed databases, refer

brainly.com/question/28236247

#SPJ4

Complete Question is ,

a. relation

b. DBMS

c. schema

d. attribute

6 0
2 years ago
To exclude members of a group from the basic permissions for a folder, which type of permission would you assign? Deny Allow Mod
oksano4ka [1.4K]

Answer:

Deny

Explanation:

Under the New Technology System, the Deny permission is applied when the administrator wants to overrule the permission given to members of a group. The Allow and Deny options help in regulating access to the components of the system. Only authorized groups are granted access to the files.

Most times, the Deny permission is considered before the Allow permission. If the user is denied access to some files and granted access to some, the deny permission is most times considered first.

4 0
3 years ago
True or false?
kenny6666 [7]

Answer:

True

Explanation:

An effective way of protecting programs against classic stack overflow attacks is to instrument the function entry and exit code to setup and then check its sack frame for any evidence of corruption.

5 0
3 years ago
Read 2 more answers
Which TWO of these correctly describe a Trojan horse malware?
mina [271]
The first one and last one
6 0
3 years ago
Read 2 more answers
Other questions:
  • When people need information, they typically turn to:
    7·1 answer
  • What precaution can you take while using a social networking site to prevent a data breach?
    15·1 answer
  • The adjustable contact of a potentiometer is placed at the center of its adjustment. If the total resistance is 5 kOhms, what is
    9·1 answer
  • What is a quick way to close the header or footer view in a microsoft word document?
    12·1 answer
  • Complete the following sentence.
    7·1 answer
  • Can find error , suppose to print what season it is and if fails : Traceback (most recent call last):
    11·1 answer
  • While developing a network application, a programmer adds functionally that allows her to access the running program without aut
    14·1 answer
  • 31
    10·1 answer
  • hi pls help me how to connect my imac to our wifi cause it’s not showing the wifi option (use pic for reference)
    7·1 answer
  • Information to develop a project network is collected from the.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!