jeudi 8 juin 2017

How does this program work. Im rookie in programming so please explain it in simplified way

please explain to me how program output

a noise
annoy
an oyester
while ( x < 4 ) {
    System.out.print("a");
    if ( x < 1 ) {
        System.out.print(" ");
    }
    System.out.print("n");
    if (x> 1 ) {
        System.out.print(" oyster");
        x = x + 2;
    }
    if ( x == 1 ) {
        System.out.print("noys");
    }
    if ( x < 1 ) {
        System.out.print("oise");
    }
    System.out.println("");
    x = x + 1; 

Aucun commentaire:

Enregistrer un commentaire