10/03/05 CISC105 Lecture Notes (0) three for loops, what is the output? Check file "forLoopQuiz.c" (0.5) Nested statements... If I have an "if", "for", "while" etc... with only one statement inside, I don't need the curly braces: for example, the following two options for this code work IDENTICALLY: /* option 1 */ x = 5; if (x < 10) { printf("x is less than 10\n"); } if (x % 2 == 0) { printf("x is an even number \n"); } /* option 2 */ x = 5; if (x < 10) printf("x is less than 10\n"); if (x % 2 == 0) printf("x is an even number \n"); (1) Review calendar, exam info on web page (2) for loops We looked at forLoopDemo.c to see a few for loops that printed lines of stars, or lines of blanks. (3) Scope: A variable declared inside a block is only known inside that block. (4) void functions with no arguments void printLineOfStars(void) { .... } (5) void functions with no one int argument void printLineOfNStars(int n ) { } (6) void functions with no one int argument and one char argument void printLineOfNChars (int n , char c ) { } (7) functions that return a numeric argument int maxOfTwoInts(int num1, int num2) { } double celsiusToFahren(double cTemp) { } Back to for loops.... while loops Printing a rectangle... Printing an empty box.