#include /* * Example from August 29, 2013 * Yes * a comment * */ #define FAHRFREEZE 32 #define CELCFREEZE 0 #define MAXVALS 10 //int z = 8; //A global variable will get a 0 on your lab in Dr T's class //int howdyfunc(int, int); int main(void) { int celsius_temp = 0, d, e, fahrenheit_temp= 42, c=0, f= 42; printf("Value of variable c is %d, d is %d, e is %d, f is %d max values are %d \n",c,d,e,f, MAXVALS); // control structures // sequential control - function call, assignment stmt // selection control - if, if - else // repetition control - // expression - evaluates to a numerical quantity // stmt - terminates with a ; and can be evaluated by the compiler // compound stmt - set of stmts grouped in curly braces printf("\nPlease enter two integer values seperated by a space: "); scanf("%d %d", &d, &e); f = d + c * e; printf("\n c before curly braces %d",c); if (c == 10) { f = 543; } else if (c < 0) { f = c*e; f = f + d; printf("\n c in curly braces %d",c); } else if (c > 100) ; printf("\n c after curly braces %d\n",c); printf("You entered d= %d and e= %d. d+c*e where c= %d is %d\n",d,e,c,f); d = d * c + e; printf("You entered e= %d. d*c+e where c= %d is %d\n",e,c,d); d *= c + e; printf("You entered e= %d. d*c+e where c= %d is %d\n",e,c,d); e +=10; c -= 9; f = d + c * e; printf("You entered d= %d and e= %d. d+c*e where c= %d is %d\n",d,e,c,f); c = howdyfunc(e, d); printf("\nHello world %d\n Print a quote \" \n", howdyfunc(e,d) ); quizfunc(c, f); return 0; } int howdyfunc(int a, int b) { int c = -543; printf("Howdy!! \n"); quizfunc(b, c); return a; } /* Pop Quiz #1 August 29, 2013 Write a function that takes in two integers and declares one integer local variable and then prints all three values and returns 0. */ int quizfunc(int j, int k) { int l = 100; printf("THe three values are %d %d %d\n ",j, k, l); //quizfunc(, ); return 0; }