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
You have repaired a broken LCD panel in a laptop computer. However, when you disabled the laptop, you bent the hinge on the lid
Alex787 [66]
Yes it would take a second or todo
8 0
3 years ago
What does the machine do and how do the operators react to their work?
Stels [109]

Answer:

The answer is below

Explanation:

Machine functions or does the following:

1.  Transform energy

2.  Change force direction

3.  Increase or decrease speed

4.  Move force over a distance.

Machine operator reacts to their work in the following ways:

1.  Setting the machine for use

2.  Utilizing the machine effectively

3.  Performing machine maintenance

4.  Ensuring maximum optimization of the machine

6 0
3 years ago
What is a Forloop and what is it used for?
anastassius [24]
It is used to repeat any block of code multiple times (iteration)
6 0
3 years ago
Read 2 more answers
A hardware component that keeps data and information when the device is not powered is called a ____ device.
serious [3.7K]

It should be noted that the hardware component that keeps data and information when the device is not powered is called a storage device.

This device can be permanent or temporary storage device.

<h3>What is a storage device?</h3>

Storage device can be regarded as the device that store data.

There are different storage devices for the computer system, they includes;

  • Optical Storage Devices.
  • External HDDs
  • Random Access Memory
  • Flash memory devices.
  • Floppy Disks.

Learn more about storage device at ;

brainly.com/question/21283135

5 0
2 years ago
Assignment Background Video games have become an outlet for artists to express their creative ideas and imaginations and a great
Sphinxa [80]

Answer:

Code

import csv

def open_file():

try:

fname=input("Enter the filename to open (xxx.yyy): ")

fp=open(fname,encoding='utf-8')

return fp

except FileNotFoundError:

print("File not found! Please Enter correct filename with extension")

return open_file()

def read_file(fp):

fields = []

rows = []

csvreader = list(csv.reader(fp))

# skiped 1 row because it contains field name

fields = csvreader[0]

D1={}

D2={}

D3={}

# accessing the data of csv file

for line in csvreader[1:]:

name = line[0].lower().strip()

platform = line[1].lower().strip()

if line[2]!='N/A':

year = int(line[2])

else:

year=line[2]

genre = line[3].lower().strip()

publisher = line[4].lower().strip()

na_sales = float(line[5])

eur_sales = float(line[6])

jpn_sales = float(line[7])

other_sales = float(line[8])

global_sales=(na_sales+eur_sales+jpn_sales+other_sales)*1000000

if name not in D1:

D1[name]=[]

D1[name].append((name, platform, year, genre, publisher,global_sales))

if genre not in D2:

D2[genre]=[]

D2[genre].append((genre, year, na_sales, eur_sales,jpn_sales, other_sales, global_sales))

if publisher not in D3:

D3[publisher]=[]

D3[publisher].append((publisher, name, year, na_sales,eur_sales, jpn_sales, other_sales, global_sales))

# sorting

temp={}

# sorting keys

for Keys in sorted (D1) :

ls=D1[Keys]

ls=sorted(ls,key=lambda x: x[-1]) # sorting values

temp[Keys]=ls

D1=temp.copy()

temp={}

# sorting keys

for Keys in sorted (D2) :

ls=D2[Keys]

ls=sorted(ls,key=lambda x: x[-1]) # sorting values

temp[Keys]=ls

D2=temp.copy()

temp={}

# sorting keys

for Keys in sorted (D3) :

ls=D3[Keys]

ls=sorted(ls,key=lambda x: x[-1]) # sorting values

temp[Keys]=ls

D3=temp.copy()

return D1,D2,D3

 

def main():

fp=open_file()

D1,D2,D3=read_file(fp)

# displaying the row_count in dictionaries

cnt=0

for d in D1:

cnt+=1

print(cnt)

print("\n\n=============================================\n\n")

cnt=0

for d in D2:

cnt+=1

print(cnt)

print("\n\n=============================================\n\n")

cnt=0

for d in D3:

cnt+=1

print(cnt)

print("\n\n=============================================\n\n")

 

 

if __name__=="__main__":

main()

Explanation:

see code and see output attached

7 0
3 years ago
Other questions:
  • Which of the four basic functions of a computer refers to the collection of data by a computer?
    11·2 answers
  • Corey is an architect. What software does he most likely use to design houses? graphic software scheduling software CAD software
    10·2 answers
  • Write a function named printtriangle that receives a parameter that holds a non-negative integer value and prints a triangle of
    7·1 answer
  • An app where you spin a wheel for coins and exchange for giftcards
    6·1 answer
  • Is it better to meet online or offline<br> (Please answer QUICK)<br><br> Thanks :')
    5·2 answers
  • Which statement uses the example type of context clue for the underlined word?
    5·2 answers
  • The add_prices function returns the total price of all of the groceries in the dictionary. Fill in the blanks to complete this f
    15·1 answer
  • Pls help... : Slide layouts can be changed by _____.
    9·1 answer
  • The =COUNT function calculates what value?
    15·2 answers
  • What stipulates that the source code of any software published under its license must be freely available.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!