/* File: local2.c Demonstrates local variables. */ #include int add9 (int a) { // THIS PART IS DELIBERATELY BUGGY int a ; // can't have local var with same name int add9 ; // C alows this, but still a bad idea add9 = a + 9 ; return add9 ; } int main() { int n = 75 ; int m = 19 ; int b ; printf("In main(), n=%d, m=%d\n", n, m) ; b = add9(m) ; printf("In main(), n=%d, m=%d, b=%d\n", n, m, b) ; b = add9(n/3) ; printf("In main(), n=%d, m=%d, b=%d\n", n, m, b) ; add9(1 + 34/2 * 4) ; return 0 ; }