/** This program is intended to be used with the book "Java 7 -- What Do You Want To Do?"
 * by Steven P. Warr and is distributed free of charge and without and expectations of remuneration.
 * Chapter ALG   NOTE all program names begin with the title of the chapter in which
 * they are intended to be used.   Copyright 2010 Steven P. Warr All rights reserved
 */
 //alg 08
import java.util.*; 
import java.io.*; 
// recursion
public class Alg08
{
   public static void main(String[ ] args) throws IOException
     {
 	      recurse(10);	
     }		
public static void recurse(int a)
{
	 int x = a;
     if ( x == 0)      //base case
        return;
     System.out.println("Pushing address on the stack " + a);   
     recurse (a-1);    //recursive case  
     System.out.println("Popping address off the stack " + a);   

}
}
