English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

9 answers

two ways:
1. use escape sequence \%
2. write twice % sign
e.g.
1. printf("I got 79.3%%");
2. printf("I got 79.3\%");

2006-09-26 00:45:45 · answer #1 · answered by pragyp 2 · 0 1

The answer is already out there.... use the escape char "\"
printf("I got 90\%"); gives I got 90%

2006-09-26 00:46:25 · answer #2 · answered by Indian_Male 4 · 0 0

There is 'Escape Sequence' for this puprose...
To write special characters you need to put an escape charatcer '\' (backslash) before it.
e.g.

% \%
\ \\
etc.

2006-09-26 00:41:17 · answer #3 · answered by Abdullah A 3 · 0 1

u have to enter the % symbol within the double quotes

2006-09-26 00:35:57 · answer #4 · answered by divyays 1 · 0 1

printf("printing %% here ");

Output: printing % here

Trick: Just use %% to print % in any printf statement...

2006-09-26 00:39:55 · answer #5 · answered by Coder.in 1 · 1 0

printf("The Percent Sign is: \%");

2006-09-26 00:48:55 · answer #6 · answered by Anonymous · 0 0

"escape it"
like this: \%

2006-09-26 00:36:13 · answer #7 · answered by maja 2 · 1 1

printf("%");

2006-09-26 00:41:25 · answer #8 · answered by sandy 3 · 0 1

%%

2006-09-26 00:45:57 · answer #9 · answered by ri_ma_bo 4 · 0 0

fedest.com, questions and answers