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
Aleksandr [31]
2 years ago
11

In C!!

Computers and Technology
1 answer:
lapo4ka [179]2 years ago
4 0

Answer:

#include <stdio.h>

void SwapValues(int* userVal1, int* userVal2)

{

int temp = *userVal1;

*userVal1 = *userVal2;

*userVal2 = temp;

}

int main(void)

{

int a = 3;

int b = 8;

printf("Before swap: a=%d, b=%d\n", a, b);

SwapValues(&a, &b);

printf("After swap:  a=%d, b=%d\n", a, b);

return 0;

}

Explanation:

For swapping variables efficiently, you need a helper variable in C or C++.

You might be interested in
The __________ algorithm takes the ciphertext and the secret key and produces the original plaintext
Bad White [126]
The answer is decryption
8 0
2 years ago
A teacher wants a program to give extra points to students who fail a test. Write a Python program to do the following: (a) Ask
Lorico [155]

Answer:

Hi there! Please find the answer below.

Explanation:

The program below demonstrates how each of the requirements can be coded in a simple Python script. To copy the array, we can use the copy() method of the array. To calculate the diff, we can use a few different techniques, so I have implemented it using a loop over the arrays and just storing and displaying the difference in the 2 arrays.

new_string.py

def add_test_score(score):

 test_score.append(score);

contact_hash = {}

test_score = []

print("Enter 5 test scores: ");

for x in range(0, 5):

   input_string = input("Enter test score " + str(x + 1) + ": ")

   add_test_score(int(input_string));

print(test_score);

test_score_copy = test_score.copy();

for e in test_score_copy:

   if e < 60:

       test_score_copy[test_score_copy.index(e)] += 10;

diff = [];

for e in test_score:

   print(test_score[test_score.index(e)]);

   print(test_score_copy[test_score.index(e)]);

   if not test_score[test_score.index(e)] == test_score_copy[test_score.index(e)]:

       diff.append(e);

print(diff);

8 0
3 years ago
Write a program to find the product of 3 numbers
ziro4ka [17]

Answer:

#include<iostream>

using namespace std;

int main()

{

   int a,b,c;

   cout<<"enter the value of a:";

   cin>>a;

   cout<<"enter the value of b:";

   cin>>b;

   cout<<"enter the value of c:";

   cin>>c;

   cout<<"product is:"<<(a*b*c);

   return 0;

}

Explanation:

6 0
3 years ago
Read 2 more answers
Black box testing is the practice of writing tests without knowing the implementation of the code you're testing. White box test
Lelu [443]

Answer:

<u>First test:</u> Give a list of disordered numbers to the sorting algorithm an examine if the output is correctly sorted.

<u>Second test:</u> Give a list of ordered numbers to the sorting algorithm an analyze if the output is still correctly ordered.

<u>Third test:</u> Give a list of ordered numbers and some non-numeric values to the sorting algorithm and check how is managed the exception in case of error or if the output is correctly ordered.

6 0
3 years ago
When you connect a new hardware device to your computer, the operating system uses a feature called _______ so you can use the n
dalvyx [7]

Answer: Plug and play

Explanation:

Adding a new hardware to the computer activate the plug and play module of the operating system which installs the hardware device into the computer and enables us to use it immediately.

6 0
2 years ago
Other questions:
  • In the following statement:
    12·1 answer
  • What is the difference between pulse code modulation and delta modulation? Provide examples.
    11·1 answer
  • What should you use as the argument for the goto() command?
    6·1 answer
  • ____ data exist in a format that does not lend itself to processing that yields information.
    8·1 answer
  • In Java, it is possible to create an infinite loop out of while and do loops, but not for-loops. true or false
    11·1 answer
  • List and describe the tools for all the main stages of app/application development.
    11·1 answer
  • Fair Use means a teacher can take the contents of a web activity page and repost it in your school's web site because it is for
    7·1 answer
  • 9.1.3: Printing vector elements with a for loop. Write a for loop to print all NUM_VALS elements of vector courseGrades, followi
    5·1 answer
  • How do the principles behind the Agile Manifesto suggest approaching architecture?A. Architecture emergesB. Architecture is not
    10·1 answer
  • SUMMING THE TRIPLES OF THE EVEN INTEGERS FROM 2 THROUGH 10) Starting with a list containing 1 through 10, use filter, map and su
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!