All pastes #339481 Raw Edit

Stuff

public java v1 · immutable
·published 2007-02-04 03:12 UTC
rendered paste body
	public static void main( String args[] ) {		String n1 = Input.in("Enter a number");		String n2 = Input.in("Enter a second number to perform XOR");		int first = Integer.parseInt(n1);		int key = Integer.parseInt(n2);		int a = first ^ key;		int b = a ^ key;		System.out.println(first+" XOR "+key+" == "+a);		System.out.println(a+" XOR "+key+" == "+b);		System.out.println("|// This simple program demonstrates the power //|");		System.out.println("|// of the logical OR operator (XOR) which     //|");		System.out.println("|// deals with data at a binary level. Ex:     //|");		System.out.println("|// Num1 XOR key == Num2                       //|");		System.out.println("|// Num2 XOR key == Num1                       //|");		System.out.println("|// Therefore it is very useful for encryption //|");		Input.waitforexit();	}