/**************************************************************************** * buggy4.c * * Computer Science 50 * David J. Malan * * Should increment a variable, but doesn't! * Can you find the bug? ***************************************************************************/ #include // function prototype void increment(void); int main(void) { int x = 1; printf("x is now %d\n", x); printf("Incrementing...\n"); increment(); printf("Incremented!\n"); printf("x is now %d\n", x); } /* * Tries to increment x. */ void increment(void) { x++; }