import java.util.*;
import java.io.*;
public class Aman
{
public static void main(String[] args)
{
// Variable to be read from the user
// Prompt for and read an integer value
System.out.print("Integer: ");
Scanner Keyboard=new Scanner(System.in);
int number;
number=Keyboard.nextInt();
// Display the result of complementing the number
System.out.println(" ~" + number + " = " + ~number);
}
}
Output:

|