Intro to Java Series Quiz 4 - Decision Making
Welcome to the fourth quiz of the Intro to Java Series. This quiz will review key concepts learned in the fourth section of the series.
Note that none of the quiz results are saved. This is for practice only.
Examine the following code. What is the expected output?
public class Main {
public static void main(String[] args) {
int x = 5;
int y = 5;
int z = 10;
if((x+y)%z==0){
System.out.println("yep");
}
else{
System.out.println("nope");
}
}
}
Examine the following code. What is the expected output?
public class Main {
public static void main(String[] args) {
int x = 5;
int y = 5;
int z = 10;
System.out.println((x + y == z) && (z - y == x));
}
}