What does the escape sequence `\n` represent in a C string?
A
Null character B
Tab space C
Newline D
Double quote
Analysis & Theory
`\n` is used to insert a newline in a string.
Which escape character is used to insert a tab space in a string?
A
\n B
\t C
\b D
\s
Analysis & Theory
`\t` inserts a horizontal tab.
How do you include a double quote (`"`) inside a string in C?
A
Use `\"` B
Use `'"'` C
Use `"""` D
Use `/"`
Analysis & Theory
Use `\"` to print a double quote inside a string.
What does the escape sequence `\\` represent?
A
Double backslash B
Newline C
Single backslash D
Tab space
Analysis & Theory
`\\` is used to display a single backslash `\`.
Which escape sequence represents the null character in C strings?
A
\n B
\\ C
\t D
\0
Analysis & Theory
`\0` is the null character used to terminate C strings.
What is the output of the following code?
```c
printf("Hello\nWorld");
```
A
HelloWorld B
Hello World C
Hello\nWorld D
Hello
World
Analysis & Theory
`\n` causes a line break: `Hello` and `World` are printed on separate lines.
Which escape sequence moves the cursor to the beginning of the line?
A
\t B
\b C
\r D
\n
Analysis & Theory
`\r` is a carriage return; it moves the cursor to the start of the line.
What is the use of `\b` in a string?
A
Tab B
Backslash C
Backspace D
Null
Analysis & Theory
`\b` is the backspace character; it moves the cursor one space back.
Which escape sequence is used to trigger a beep (if supported)?
A
\b B
\a C
\z D
\r
Analysis & Theory
`\a` is the alert (bell) character that may trigger a system beep.
What does this print?
```c
printf("C\"Lang\"");
```
A
CLang B
C"Lang" C
C\Lang\ D
C"Lang
Analysis & Theory
`\"` prints double quotes, so the output is `C"Lang"`.