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
Andrej [43]
3 years ago
13

Given three already declared int variables, i, j, and temp, write some code that swaps the values in i and j. Use temp to hold t

he value of i and then assign j's value to i. The original value of i, which was saved in temp, can now be assigned to j.
Computers and Technology
1 answer:
balandron [24]3 years ago
6 0

Answer:

public class newass {

   public static void main(String[] args) {

          int i = 5,j=6,temp;

           System.out.println("--Before swap--");

           System.out.println("First number = " + i);

           System.out.println("Second number = " + j);

           // Value of first is assigned to temporary

          temp = i;

           // Value of second is assigned to first

           i = j;

           // Value of temporary (which contains the initial value of first) is assigned to second

           j = temp;

           System.out.println("--After swap--");

           System.out.println("First number = " + i);

           System.out.println("Second number = " + j);

       }

   }

Explanation:

That is a java code that accomplishes the task. we start off by assigning initial values (5 and 6) respectively to i and j. We first print this out, then using a the temp values we swap the values and print out.

You might be interested in
For BitTorrent, which of the following is true:
Bumek [7]

Answer:

d. All of the above

Explanation:

All the above mentioned statements are true about BitTorrent.

8 0
3 years ago
Which type of network involves buildings in multiple cities connecting to each other?
NeX [460]

Answer:

Power lines

Explanation:

Because their everywhere

4 0
3 years ago
Which of the following is something that all computer models use in their calculations?
Rzqust [24]
The answer is 4 because all computers use variables to process something
8 0
3 years ago
Whenever I ask a question I loose points I just asked a question before and I had 56 points now I have 12 now I'll probably have
lilavasa [31]
Just try to answer some questions as well, then you can keep a nice balance.
ps. Only answer the questions you know. 
5 0
3 years ago
All the processing-of work-done on a computer is performed by the what?
Nat2105 [25]
It's computed by the processor
6 0
4 years ago
Other questions:
  • Which line of code will generate a random integer between 7 and 77?
    10·1 answer
  • Holly Carpenter argues that technology may actually prevent some kinds of evolution that would benefit humans. Do you agree with
    8·2 answers
  • An airline company would like to easily locate lost luggage. What technology would make it easier for them to locate the luggage
    6·2 answers
  • What is the purpose of the overload keyword in the ip nat inside source list 1 pool nat_pool overload command?
    8·1 answer
  • Describe a time when you influenced someone else’s knowledge around technology, whether it be an app, a new gadget, etc. What di
    14·1 answer
  • Which of the following is the correct order of the SDLC?
    14·1 answer
  • Who all likes fortnite
    15·2 answers
  • HELLLLLLLLPPPPPPPPPPPP HHHHHHHHHEEEEEEEEELLLLLLPPPPPP MEEEEEEEE
    12·2 answers
  • 1.a computer can create an output based on the input of the user.
    13·1 answer
  • How does 5G technology enhance the Internet of Things (IoT)?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!