How to print % using printf()
Thursday, January 23, 2014
Standard prototype of printf function in C.
In general way printf("%") will not be print % in c programming.
To print % you can use codes:
Reference: http://swoolley.org/man.cgi/3/printf
int printf(const char *format, ...);
In general way printf("%") will not be print % in c programming.
To print % you can use codes:
printf
(
"%c"
,
'%'
);
printf
(
"%s"
,
"%"
);
The another way of printing % by printf() is:
#include<stdio.h>
int
main()
{
printf
(
"%%"
);
return
0;
}
Reference: http://swoolley.org/man.cgi/3/printf
Labels: C
Post a Comment