From 0e2586459f6b7c389a6c4fade4c71a59736fd44b Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:20:04 -0700 Subject: [PATCH] vault backup: 2024-11-03 14:20:04 --- .../ECE1400/Chapter 13 Exercises.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/education/software development/ECE1400/Chapter 13 Exercises.md b/education/software development/ECE1400/Chapter 13 Exercises.md index 03deb8c..40f549a 100644 --- a/education/software development/ECE1400/Chapter 13 Exercises.md +++ b/education/software development/ECE1400/Chapter 13 Exercises.md @@ -1,4 +1,4 @@ -> 1. The following function calls supposedly write a single new-line character, but some are incorrect. Identify which calls don't work and explain why. +> **1.** The following function calls supposedly write a single new-line character, but some are incorrect. Identify which calls don't work and explain why. b. `printf("%c", "\n");` - This is invalid because the double quotes make `\n` a string, but it's being displayed with the `%c`formatting specifier. c. `printf(%s, '\n');` - This is invalid because it's trying to display a `char` using the string formatting specifier. @@ -6,8 +6,9 @@ e. `printf('\n');` - `printf`'s first argument should be a string, not a `char`. h. `putchar("\n");` - `putchar`'s first argument should be a `char`, not a string. i. `puts('\n');` - `puts`'s first argument should be a string, not a `char`. j. `puts("\n");` - `puts` will write a newline after writing a string, so this will write two newlines. +