100% found this document useful (3 votes)
3K views491 pages

Use A Cabeça Java - 2 Edição

The code prints different letters and strings to the console based on the value of variable x as it counts down from 3 to 0. When x is greater than 2, it prints "a". It prints "-" each time before decreasing x by 1. When x is equal to 2, it prints "b c". When x is equal to 1, it prints "d" and then decreases x one final time to end the loop.

Uploaded by

Gabriel Filipi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
3K views491 pages

Use A Cabeça Java - 2 Edição

The code prints different letters and strings to the console based on the value of variable x as it counts down from 3 to 0. When x is greater than 2, it prints "a". It prints "-" each time before decreasing x by 1. When x is equal to 2, it prints "b c". When x is equal to 1, it prints "d" and then decreases x one final time to end the loop.

Uploaded by

Gabriel Filipi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 491

class Shffle1 {

public static void main(String[] args){


int x = 3;
while( x > 0){
if( x > 2){
System.out.print("a");
}
x = x - 1;
System.out.print ("-");
if ( x == 2){
System.out.print("b c");
}
x = x - 1;
if (x == 1){
System.out.print("d");
x = x - 1;
}
}
}
}

You might also like