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

In C!!

Computers and Technology
1 answer:
lapo4ka [179]3 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
Greyer Corp, manufactures surgical instruments. Systems Medico Inc. enters into a contractual arrangement with Greyer that allow
hammer [34]

Answer: Licensee

Explanation:

Licensee is defined as the person who holds the licence after receiving it. He/she is known as license holder who receives it from the licensor. Licensee has the official right and permit to use a service or good.

According to the question, Greyer Corp. is granting the license to System Medico as a licensor so that they can indulge with them to manufacture and sell surgical tools.

For this agreement ,System Medico is paying a yearly fee in the form of permit (license) to access the services of Greyer Corp along with the agreement in the form of licensee

8 0
3 years ago
Outline various methods of collecting data
Sati [7]

Answer:

interviews

observation

questionering

3 0
2 years ago
We can save our data peremently on a
riadik2000 [5.3K]

Answer:

modem

Explanation:

hope it helps

4 0
3 years ago
Read 2 more answers
Should Manufacturers Include Extra Programs in Operating Systems for Computers and Mobile Devices?
Gennadij [26K]

Answer:

Well, it depends. Sometimes the extra programs can be useful or just plain fun, in which case the answer is yes. But extra programs can also sometimes be utterly useless and get in the way, in which case the answer is no.\

4 0
3 years ago
A program that accepts insurance policy data, including a policy number, customer last name, customer first name, age, premium d
valentina_108 [34]

Answer:

  1. policy_num = int(input("Enter policy number: "))
  2. lastName = input("Enter last name: ")
  3. firstName = input("Enter first name: ")
  4. premiumDate = input("Enter premius due date (mm/dd/yyyy): ")  
  5. numAcc = int(input("Enter number of driver accident in the past three years: "))
  6. if(policy_num <1000 or policy_num > 9999):
  7.    policy_num = 0  
  8. dateComp = premiumDate.split("/")
  9. month = int(dateComp[0])
  10. day = int(dateComp[1])
  11. year = int(dateComp[2])
  12. if(month < 1 or month > 12):
  13.    month = 0
  14.    day = 0
  15.    year = 0  
  16. else:
  17.    if(month == 1 or month == 3 or month == 5 or month == 7 or month == 8 or month == 10 or month == 12):
  18.        if(day < 1 or day > 31):
  19.            month = 0
  20.            day = 0
  21.            year = 0  
  22.    elif(month == 4 or month == 6 or month == 9 or month == 11):
  23.        if(day <1 or day > 30):
  24.            month = 0
  25.            day = 0
  26.            year = 0
  27.    elif(month == 2):
  28.        if(day < 1 or day > 29):
  29.            month = 0
  30.            day = 0
  31.            year = 0
  32. print("Policy number: " + str(policy_num))
  33. print("Last name: " + lastName)
  34. print("First name: " + firstName)
  35. print("Premium Date: " + str(month) + "/" + str(day) + "/" + str(year))
  36. print("Number of driver accidentin the last three years: " + str(numAcc))

Explanation:

The solution code is written in Python 3.

Firstly use input function to prompt user to enter all the necessary insurance policy data (Line 1 - 5).

Next create an if statement to validate the input policy number. If the policy number is not within the range of 1000 - 9999, set the policy number to zero (Line 7 -8).

Next, split the input premium date into month, day and year (Line 10 -13). It is followed by checking the month if it is between 1 - 12. If not, set the month, day and year to zero (Line 15 - 18). Otherwise the program will proceed to validate the month based on the maximum and minimum number of days for a particular month (Line 20 - 34). If the day is out of range, set month, day and year to zero.

Lastly, use print function to display the policy data (Line 36 - 40).

8 0
4 years ago
Other questions:
  • I need to create a function that returns Pascal's Triangle with n rows, where n is an int argument.
    12·1 answer
  • What is the purpose of system calls, and how do system calls relate to the OS and to the concept of dual-mode (kernel-mode and u
    14·1 answer
  • You need to provide connectivity between two buildings without running any cables. You decided to use two 802.11ac APs to provid
    14·1 answer
  • What is a preemptive CPU scheduling algorithm? Give an example and explain.
    7·1 answer
  • Write a short program that uses a for loop to write the numbers 1 through 10 to a file
    11·1 answer
  • After pushing the power switch of the PC to the ʺonʺ position, Bob, the PC repair person, realizes that the power-on lights foun
    8·1 answer
  • Resumen sobres el correo electrónico​
    6·1 answer
  • Write Python code to convert miles to kilometers. This does not need to be written in a Python function, but it should use the i
    8·2 answers
  • Can someone please help me with this ,it is my assignment of technology and agriculture year 8
    5·1 answer
  • How many combinations of 1s and Os can we make with 6 place values?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!