self
Maths Puzzle
What is the value of x after the following code fragment is executed?
a = 9, b = 8, c = 4
if (c divides a) {
if (b > c) {
x = 1
} else {
x = 2
}
} else {
if (c divides b) {
x = 3
} else {
x = 4
}
}
Read Solution (Total 2)
-
- x will be 3
- 11 years agoHelpfull: Yes(0) No(0)
- since c divides b so x =3
- 11 years agoHelpfull: Yes(0) No(0)
self Other Question