Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

swap two numbers

    public static void main(String[] args) {
        int x = 10;
        int y = 20;
        
        x=x+y;
        y=x-y;
        x=x-y;

        System.out.println("x:"+x+" y:"+y);
    }
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged: #swap #numbers
ADD COMMENT
Topic
Name
3+8 =