ARITHMETIC EXPRESSIONS




Task
Given two variables that are entered from the keyboard. It is necessary to interchange the values of these variables: in the variable a, what was previously stored in b should be written, and in the variable b, what was previously stored in a should be written. Then these variables are output, first the variable a, then b
Complete the program with the necessary operators.
Java
1
import java.util.Scanner;   
2
public class Main {   
3
    public static void main(String[] args) {   
4
        Scanner in = new Scanner(System.in);   
5
        int a = in.nextInt();   
6
        int b = in.nextInt();   
7
8
9
10
        System.out.print(a+" "+b);   
11
    }   
12
}   
Your last submission is saved in the editor window.
     

Results:

All results: