Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Ludwing Najera
Ludwing Najera
4,596 Points

what's wrong here?

i made some code on my lesson and what i got was way different. i had to have the output to be like this: a 9 a 10 c 9 a 9 c 10 and i got: a 9 a 10 c 9 a 9 c 9 and here is my code

#include <stdio.h>

int main(int argc, const char * argv[]) {

// insert code here...

int a = 9;
printf("a %d\n", a);

int c = a++;
printf("a %d c %d\n", a, c);

int b = a--;
printf("a %d c %d\n", a, c);
return 0;

1 Answer

Laurence Stokes
Laurence Stokes
6,109 Points

// insert code here...

int a = 9; printf("a %d\n", a);

int c = a++; printf("a %d c %d\n", a, c);

int c = a--; printf("a %d c %d\n", a, c); return 0;

Re-assign c. int b is redundant!