How to insert quote characters (‘ , \) into the output in C language?

Home Forums C How to insert quote characters (‘ , \) into the output in C language?

Tagged: , , , ,

This topic contains 1 reply, has 2 voices, and was last updated by  ruchira.rawat@gmail.com 9 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #687

    admin
    Keymaster

    This is a common problem for beginners because quotes are normally part of a printf statement. To insert the quote character as part of the output, use the format specifiers \’ (for single quote), and \” (for double quote).
    Eg:
    printf(“HELLO WORLD \\ \n”) ;

    OUTPUT:
    HELLO WORLD \\

    #2027

    Output will be:

    HELLO WORLD \

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.