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

Objective C - Basic Question

Hi Treehouse,

Still new to Objective C and trying to practice on my own. Below is a code that is failing to build, what am I doing wrong?

int main() { int high = 2; int five = 5;

if (high > five);
{
    printf(" That was a sweet High Five!\n");

}

else (high < five);

{
    printf("That was weak sauce, dude\n");
}


return 0;

}

2 Answers

Hi. Please remove the semi-colon after the conditions

Like this.

if (high > five) {
    printf(" That was a sweet High Five!\n");
}

else (high < five) {
    printf("That was weak sauce, dude\n");
}

Let me know if this helps you. :)

That did it!

Thanks for taking a few moments to help a newbie out. :)

No worries. Just practice and practice and practice and you'll be good at it. :)