Skip to content

Commit 6a4c48e

Browse files
committed
added exercise 11 to see what it does
1 parent cdd5410 commit 6a4c48e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Chapter 5/a.exe

0 Bytes
Binary file not shown.

Chapter 5/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ int main () {
3535
printf("Storm");
3636
else // speed > 63
3737
printf("Hurricane");
38+
printf(".\n"); // end constructed sentence
39+
40+
// Question 11:
41+
/* Is the following IF statement legal in C? */
42+
int n = 0;
43+
if (n >= 1 <= 10)
44+
printf("n is between 1 and 10\n");
45+
// Evaluates incorrectly because the first statement is tested, then the right statement is tested (and will always be true when n = 0
3846

3947
return 0;
4048
}

0 commit comments

Comments
 (0)