diff --git a/education/software development/ECE1400/Chapter 7 Exercises.md b/education/software development/ECE1400/Chapter 7 Exercises.md index 23806b5..5f2538d 100644 --- a/education/software development/ECE1400/Chapter 7 Exercises.md +++ b/education/software development/ECE1400/Chapter 7 Exercises.md @@ -3,4 +3,24 @@ a. `short unsigned int` b. `short float` c. `long double` -d. `unsigned long` \ No newline at end of file +d. `unsigned long` + +Answer: +b. `short float` + +> 4. If `c` is a variable of type `char`, which of the following statements is illegal? + +```c +char c; +// A: +i += c; // i has type int +// B: +c = 2 * c - 1; +// C: +putchar(c); +// D: +printf(c); +``` + +Answer: +D is incorrect because `printf` operates on strings. \ No newline at end of file