Skip to main content

Swap two numbers

Swap two numbers

import java.util.Scanner;
class Swapnumber {
    public static void main(String[] args) {
        int a, b, c;
        Scanner s = new Scanner(System.in);
        System.out.println("Enter Value in a :");
        a = s.nextInt();
        System.out.println("Enter Value in b :");
        b = s.nextInt();
        c = a;
        a = b;
        b = c;
        System.out.println("Values in a:" a);
        System.out.println("Values in b:" b);
    }
}

Output:
Enter Value in a : 10
Enter Value in b : 20
Value in a : 20
Value in b : 10

Popular posts from this blog

Sudo - SuperUser Access TERMUX

Sudo works on only rooted devices   sudo means superuser & root command we can run root tools in termux using sudo Execute these commands one by one to install sudo. Installation : $ apt update  $ apt upgrade $ apt install git $ apt install tsu $ apt install ncurses-utils $ git clone https://github.com/termux-sudo $ cd termux-sud $ cat sudo > /data/data/com.termux/files/usr/bin/sudo $ chmod 700 /data/data/com.termux/files/usr/bin/sudo sudo su sudo tsu Now you are a root user..

Creating a .zip file using TERMUX

Creating a .zip file using TERMUX or Kali Linux Fisrt update and install requirments .. $ apt update $ apt upgrade $ apt install zip $ apt install unzip ** Creating Zip file : $ zip name.zip [your files] Here name.zip is the name for that zip file **Unzip process : $ unzip name.zip that's it it will unzip your zip file.. Enjoy... All  Copyright  Are  Reserved ©