Advertisement
apez1

Term 1: Lesson 32 - Coding Activity 3

Nov 23rd, 2018
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.math.*;
  3.  
  4. public class Lesson_32_Activity_Three {
  5.    
  6.     static Scanner scanner = new Scanner(System.in);
  7.    
  8.     public static void swap(int input1, int input2) {
  9.        
  10.         System.out.println(input2 + " " + input1);
  11.        
  12.    
  13.     }
  14.    
  15.     public static void main(String[] args) {
  16.  
  17.         System.out.println("What are the two integers?");
  18.         int input1 = scanner.nextInt();
  19.         int input2 = scanner.nextInt();
  20.        
  21.         swap(input1,input2);
  22.  
  23.     }
  24.    
  25.    
  26.    
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement