0
How to print double quotes in C using printf?
#include <stdio.h> int main() { printf(""hey bro""); return 0; } Output should be "hey bro"
2 odpowiedzi
+ 8
Razha Garrix you have everything explained in the tutorial:
• https://www.sololearn.com/learn/C/2914/
A call to printf() function requires a format string which can include escape sequences for outputting special characters. For example,
printf("\"Hi there!\"\n"); // "Hi there!"
Escape sequences begin with a backslash \:
\n new line
\t horizontal tab
\\ backslash
\b backspace
\' single quote
\" double quote
• https://www.sololearn.com/Discuss/694770/?ref=app
• https://www.sololearn.com/Discuss/1284646/?ref=app
+ 7
You should have passed this in the tutorial. It's in the module input/output.
Maybe it's time for a review?
Answer: Backslash in front of the quotation mark.
printf("\"")