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 trialLudwing Najera
4,596 Pointswhat'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
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!