How to print double quotes in C using printf

How to print double quotes in C:

To print double quotes or using printf, we can take help of backslash. Because, directly, we can’t print double quotes in C. If we try to print like the below program, it will throw one compile error:

#include <stdio.h>

int main()
{
   printf(""");
}

C program to print double quotes :

We can use at any place inside printf to print a double quotes. For example:

#include <stdio.h>

int main()
{
   printf("\"");
}

It will print:

"

Similarly, we can add double quotes inside a string:

#include <stdio.h>

int main()
{
   printf("\"Hello World !!\"");
}

It will print:

"Hello World !!"

You might also like:

Where is the color and why codevscolor ?

Long story short, I love paintings and I paint on weekends. We(me and my wife) have one Youtube channel. Below is a video that I did recently. If you love this please do subscribe to support us 😊