top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C: How to get display '%' and '\' symbol?

0 votes
244 views
C: How to get display '%' and '\' symbol?
posted Aug 19, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

There are two ways to display these symbols.

  1. printf("%c %c", '%', '/');

  2. printf("//"); // it will print the "/" symbol as a output.
    printf("%%"); // it will print the "%" symbol as a output.

and if you want print both the symbols in a single printf(), then

  1. printf("/%%"); // output is /%
    or
  2. printf("%%/"); // output is %/
answer Aug 19, 2014 by Arshad Khan
...