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
dsp73
3 years ago
7

Write a program whose input is two integers and whose output is the two integers swapped. Place the values in an array, where x

is position 0 and y is position 1.Ex: If the input is: 3 8 then the output is: 83 Your program must define and call a method: public static void swapValues (int[] "values) LabProgram.java 1 import java.util.Scanner; 23 public class LabProgram 4 5 /* Define your method here 6 7 public static void main(String[args) { 8 /* Type your code here. / 9 } 10 } 11
Computers and Technology
1 answer:
allochka39001 [22]3 years ago
8 0

Answer:

import java.util.*;

import java.lang.*;

import java.io.*;

class Codechef

{ public static void swapValues(int[] values)

{int temp= values[0];

values[0]=values[1];

values[1]=temp;

System.out.print(values[0]+" "+values[1]);}

public static void main (String[] args) throws java.lang.Exception

{

Scanner sc= new Scanner(System.in);

int A[] = new int[2];

A[0] = sc.nextInt();

A[1]= sc.nextInt();

swapValues(A);

}

}

Input:-

3   8

Output:-

8   3

Input:-

1    2

Output:-

2   1

You might be interested in
The process of learning by making mistakes and by trial and error is called _____.
vodomira [7]
I believe it’s problem solving.
6 0
3 years ago
Which social networking function came first?
amm1812

D, Online bulletin boards.


♣Amaranthine
3 0
3 years ago
Read 2 more answers
The encapsulation unit on the presentation layer of the osi model is
Zielflug [23.3K]
<span>The encapsulation unit on the presentation layer of the OSI model is the Data link layer (2).</span>
7 0
4 years ago
Question 1(Multiple Choice Worth 5 points)
aleksley [76]

Answer:

b

Explanation:

it's not a c or d and now I have to make it 20 characters long so I will do this

3 0
3 years ago
Read 2 more answers
The output of a combiner is normally fed into a
ankoles [38]

The output of a combiner is normally fed into a mask filter. Check more about output below.

<h3>What is output?</h3>

Output is known to be that which is gotten from the act of making of anything or the amount of a thing that is processed.

Note that he output of a combiner is normally fed into a mask filter as it is the first point of contact.

Learn more about output  from

brainly.com/question/20727977

#SPJ2

7 0
2 years ago
Read 2 more answers
Other questions:
  • One of the earlier applications of crypto-graphic hash functions was the storage of passwords to authenticate usersin computer s
    13·1 answer
  • A display that is thin, flexible, light, and easy to read in all types of light is a(n) _____. touch screen computer. electronic
    13·2 answers
  • Moore’s Law is said to be more of a trend, rather than a representation of the actual number of transistors on a silicon chip. W
    14·1 answer
  • Given an array of n distinct integers,d = [d[0], d[1],.., d[n - 1]], and an integer threshold, t, how many (a,b,c) index triplet
    11·1 answer
  • To carry computer data over the long haul, wans need to have a(n) ________ in multiple towns and cities.
    10·1 answer
  • IoT is the interconnection of what?<br> Hardware<br> Networks<br> Everyday devices<br> Cables
    10·1 answer
  • What is the value of the variable named result after the following code executes? var X = 5; var Y = 3; var Z = 2; var result =
    14·1 answer
  • Which method will return the first element in an ArrayList employees?
    5·1 answer
  • I'm trying the game WWE 2k20 for my computers and technology and a extra credit question is how do you pull down the singlet str
    12·1 answer
  • The sequence of instructions performed to execute one program instruction
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!