Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P3_ExchangeIntegers {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int a = Integer.parseInt(scan.nextLine());
- int b = Integer.parseInt(scan.nextLine());
- int tempB = b;
- b = a;
- System.out.printf("Before:%n a = %d%n b = %d%n", a , tempB);
- System.out.printf("After:%n a = %d%n b = %d%n", tempB, b);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement