Computer Science, asked by drjayantaray, 9 months ago

Enter a no and interchange the digits by taking input from user in java​

Answers

Answered by Anonymous
5

Answer:

Heya✌️☺️♥️

Explanation:

✏️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();  

       System.out.println("before swapping numbers: "+x +"  "+ y);  

       /*swapping */  

       t = x;  

       x = y;  

       y = t;  

       System.out.println("After swapping: "+x +"   " + y);  

       System.out.println( );  

    }    

}  

 

✒️Hope it helps✌️☺️♥️...

Attachments:
Similar questions