Boolean Expressions

AP Computer Science A· difficulty 1/5

int a = 5;
int b = 5;
if (a <= b) {
  System.out.println("yes");
} else {
  System.out.println("no");
}

What is printed?

  • A

    true

  • B

    false

  • C

    no

  • D

    yes

    check_circle

Explanation

a <= b means "a less than or equal to b". 5 <= 5 is true, so "yes" prints.

Want 10 more like this — adaptive to your weak spots?

Related questions