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

Conditionals Quiz

Final post of the day, I promise. I have absolutely no idea what I'm supposed to write in the Conditionals Quiz. This is probably due to my tired brain, which I have been using to study for school, and then do Treehouse lessons for the past 14 hours or so.

What am I missing? My guess is that the questions have something to do with numbers instead of characters, but I'm at a loss in regards to what I need to change as a result of that.

1 Answer

Hi Paul!

I can definitely understand the tired brain ;)

I would recommend re-watching the videos in the 'Functional Programming in C' stage, as Douglass does an excellent job at explaining the control structures essential to many programming languages (not just C!)

After running through the quiz, it's certainly wanting words. A quick few tips before you go and challenge it again:

If/Else:

If statements check to see if something evaluates to 'true'. For example, if I had an int like this:

int number = 15;

I could check if the value of the int number is 15 using an if statement, like so.

if(number == 15) {
    printf("Number is 15!");
}

In addition, I could also check to see if the expression evaluates to false, by appending an else statement to the if one. If I initialized number to be 16 instead of 15, the code in the else block would be run.

if(number == 15) {
    printf("Number is 15!");
} else {
    printf("Number is not 15.");
}

Finally, we can chain multiple if statements using the else if statement in addition to the else one.

Go get some sleep, re-watch the videos, and slay that quiz!

I couldn't find the videos that deal with this, and I'm still stuck :( This did help though!