Exercise 4 4
public class exercise_4_4
{
    public static void music(int n){
        System.out.println(n + " bottles of beer on the wall, " + n + " bottles of beer, ya’ take one down, ya’pass it around, " + (n-1) + "  bottles of beer on the wall.");
        if (n-1 > 0){
            music(n-1);
        }else{
            System.out.println("end of music!");
        }    
    }
 
    public static void main(String [] args) {
        //code
        int x = 99;
        music(x);
    }
}

voltar

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.