Printing a % sign in C using 'printf'

c

Solution

Use `printf("%%");` The backslash is the escape character for C strings; the compiler interprets it. The percent sign is `printf`s escape character; the `printf` routine interprets it.

Problem

I am trying to print a `%` sign using printf. I have tried with no luck: ``` printf("\%"); ``` I'm sure it's really simple, but I've just started C.

Original source

Related problems