85.4k views
4 votes
What value will be stored in the variable t after each of the following statements

executes?

A) t = (12 > 1); __________

B) t = (2 < 0); __________

C) t = (5 == (3 * 2)); __________

D) t = (5 == 5); __________

User Renie
by
5.5k points

1 Answer

6 votes

Answer:

A) t = true

B) t = false

C) t = false

D) t = true

Step-by-step explanation:

Part A, here 12 is greater than 1 so the condition is true.That is why "t" will hold "true".Part B, here 0 is not greater than 2 so this condition fails.Therefore "t" will hold "false" in this case.Part C,3*2=6 and we are comparing 5 with 6 Therefore condition fails here.That is why "t" will hold "false".Part D, here we are comparing 5 with 5 and both are equal.So "t" will hold "true".

User Tarah
by
5.7k points