write a program in java to accept two numbers and print them after interchanging their values
Answers
Answered by
1
Explanation:
public class Swap_Integers.
int m, n, temp;
Scanner s = new Scanner(System.
System. out. print("Enter the first number:");
m = s. nextInt();
System. out. print("Enter the second number:");
n = s. nextInt();
temp = m;
Answered by
11
Explanation:
Java Program
- import java.util.*;
- class Swap_With {
- public static void main(String[] args) {
- int x, y, t;// x and y are to swap.
- Scanner sc = new Scanner(System.in);
- System.out.println("Enter the value of X and Y");
- x = sc.nextInt();
- y = sc.nextInt();
Attachments:
Similar questions
Math,
3 months ago
English,
7 months ago
Science,
7 months ago
Math,
11 months ago
Environmental Sciences,
11 months ago