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"

19th Mar 2020, 6:00 PM
Sk. Ahmed Razha Khan
Sk. Ahmed Razha Khan - avatar
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=apphttps://www.sololearn.com/Discuss/1284646/?ref=app
19th Mar 2020, 7:03 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 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("\"")
19th Mar 2020, 6:06 PM
HonFu
HonFu - avatar