![nate7742](/avatars/22838.jpg)
nate7742
31.03.2020 •
Computers and Technology
G If you write a C function, named swap, that takes two integers as input arguments and swap them internally. Assume the function returns nothing. Write down the function declaration
Solved
Show answers
More tips
- S Society and Politics What Would Brezhnev Do If He Were Alive Today?...
- S Style and Beauty Choosing a Hair Straightener: Specific Criteria to Consider...
- F Family and Home How to Remove Tar Stains: Tips and Recommendations from Experts...
- F Family and Home How to Remove Fading from Clothes: Tips and Tricks...
- S Sport How to Do a Jumping Split...
- H Health and Medicine How Did Inna Lose Weight on Dom 2?...
- F Family and Home How to Properly Fold Napkins in a Napkin Holder?...
- F Food and Cooking How to Set Up Ventrilo - The Ultimate Guide...
- S Science and Technology How to Make a Homemade Smoker: The Ultimate Guide...
- A Auto and Moto Battle for the Relocation of The Cherkizovsky Market: Who Won?...
Answers on questions: Computers and Technology
- C Computers and Technology Radio stations broadcast signals on two different frequency bands. These are called and ....
- M Mathematics I’ll cash app you if you help me please if the answer is right drop your cash app when you drop the answer plz...
- E English Would rather rule the world, or make a world ?...
- M Mathematics Evaluate 32 when 2 = 9....
- H History Question 1 (1 point) Why was the institution of slavery a paradox in the United States? People in the North refused to allow escaped enslaved people to live in the...
- C Computers and Technology Create a table called Publisher having the following structure: Field Name Data TypePubID Short TextPubName Short TextURL HyperlinkSet the field PubID as the primary...
- M Mathematics Change the voice of do you repair cars...
- M Mathematics Plz help ASAP 20 Points Determine the equation of circle A. (x - 1)2 + (y + 2)2 = 9 (x + 1)2 + (y-2)2 = 9 (x-1)2 + (y + 2)2 = 3 (x + 1)2 + (y-2) = 3...
- H History How did the Amritsar massacre affect Britain both at home and abroad?...
- M Mathematics What is the distance around a circle called? A. Radius B. DiameterC. Circumference D. Chord...
Ответ:
void swap(int number1, int number2) {
printf("Values before swapping: %d %d \n", number1, number2);
int temp;
temp = number1;
number1 = number2;
number2 = temp;
printf("Values after swapping: %d %d \n", number1, number2);
}
Explanation:
- Print the initial values to see the change
- Declare a temporary variable temp
- Assign the value of the number1 to the temp
- Assign the value of the number2 to number1 (The first number is swapped)
- Assign the temp value to the number2 (The second number is swapped)
- Print the new values
Ответ: