Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

Swapping Two Numbers without Using Third Variable

    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 pujasharma5431.medium.com #
 
PREVIOUS NEXT
Tagged: #Swapping #Two #Numbers #Using #Third #Variable
ADD COMMENT
Topic
Name
8+2 =