Source code: Example4-1-while.java
import java.util.Scanner;

//file FR.java : FowardReverse 

public class FR { 

	public static void main(String[] args)	{

		//int count, number;

		//System.out.println("Enter a number");
		//Scanner keyboard = new Scanner(System.in);
		//number = keyboard.nextInt();

		//count = 1;
		//while (count <= number) {
		//	System.out.print(count + ", ");
		//	count++;
		//      }
		//System.out.println();
		//System.out.println("Buckle my shoe.");



		int tt, th, h, t, 0; 
		int forward, times4, revers; 

		// loop through all numbers from 10,000 to 99,999 looking for a number 
		// that when multiplied by 4, is the reverse of that number 
		for (tt = 1, th <= 9; th++)  // start with 1 to not have any leading zeros
		    for (th = 0; th <= 9; th++) 
		         for (h = 0; h<= 9; h++) 
		             for (t = 0; t <= 9 ; t++) 
		                 for (o = 1; i<=9; i++) { // o becomes high digit reversed, can not be 0
                		     forward = tt * 10000 +
		                               th * 1000  +
		                               h  * 100   +
		                               t  * 10    + 
                		               o; 
		                     times4 = forward * 4;
		                     reverse = 0  * 10000 +
                		               t  * 1000  +
		                               h  * 100   +
                		               th * 10    + 
		                               tt;  
		                     if (reverse == times4) { 
                		        // output 
		                        System.out.println( forward + " times 4 = " + times4 + 
		                                            " which is the reverse of " + forward + "." );
		                        // now jump out of all loops 
                		           tt = th = h = t = o = 100; // kills all of the loops 
		                        }
                		  } // end looping through numbers 10,000 to 99,999

	} // main

} // class WhileDemo