Cikku Phantomhive Kimmy

By Juli Retno Phalupy

Tugas Algoritma 4b

March29

Soal :

1. Assuming that x is 1, show the result of the following Boolean expressions.
• (true) && (3 > 4)
• !(x > 0) && (x > 0)
• (x != 1) == !(x == 1)
• (x >= 0) || (x < 0)

2. List the precedence order of the Boolean operators. Evaluate the following expressions:
• 2 * 2 – 3 > 2 && 4 – 2 > 5
• 2 * 2 – 3 > 2 || 4 – 2 > 5

3. Is (x > 0 && x 0) && (x 0 || x < 10 && y 0 || (x < 10 && y < 0))?

Jawaban :

1.
Tugas4bno1

Hasil : a. false
b. false
c. true
d. true

2.
Tugas4bno2

Hasil : a. false
b. false

3.
Tugas4bno3

Hasil :
true true
true true

www.binus.ac.id

posted under Uncategorized

Email will not be published

Website example

Your Comment: