Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift 2.0 Collections and Control Flow Control Flow With Conditional Statements Recap: Control Flow with Conditional Statements

Aditya Gawade
Aditya Gawade
1,182 Points

did not understand the question

What does the following statement evaluate to? (!true || !false) && (true && !false)

option : a. true b. false

2 Answers

Kristopher Wood
seal-mask
.a{fill-rule:evenodd;}techdegree
Kristopher Wood
iOS Development Techdegree Student 5,552 Points

(!true || !false) = (not true or not false) = (false or true) = true && (and) (true && !false) = (true and not false) = (true and true) = true true and true = true

(A) True

If you break it down, remember the ! sign is the oppsisite so !true is false and !false is true. The || sign means OR and the && defines AND.

So if you look at it again ... (!true || !false) && (true && !false) = false or true AND true and true. Which would seem to be (B) False